like lodepng_chunk_create but with custom allocsize */
| 2604 | |
| 2605 | /* like lodepng_chunk_create but with custom allocsize */ |
| 2606 | static unsigned lodepng_chunk_createv(ucvector* out, |
| 2607 | unsigned length, const char* type, const unsigned char* data) { |
| 2608 | unsigned char* chunk; |
| 2609 | CERROR_TRY_RETURN(lodepng_chunk_init(&chunk, out, length, type)); |
| 2610 | |
| 2611 | /*3: the data*/ |
| 2612 | lodepng_memcpy(chunk + 8, data, length); |
| 2613 | |
| 2614 | /*4: CRC (of the chunkname characters and the data)*/ |
| 2615 | lodepng_chunk_generate_crc(chunk); |
| 2616 | |
| 2617 | return 0; |
| 2618 | } |
| 2619 | |
| 2620 | unsigned lodepng_chunk_create(unsigned char** out, size_t* outsize, |
| 2621 | unsigned length, const char* type, const unsigned char* data) { |
no test coverage detected