Lines Matching refs:chunkLength
4254 …tic unsigned readChunk_PLTE(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) in readChunk_PLTE() argument
4258 color->palettesize = chunkLength / 3; in readChunk_PLTE()
4278 …tic unsigned readChunk_tRNS(LodePNGColorMode* color, const unsigned char* data, size_t chunkLength) in readChunk_tRNS() argument
4284 if(chunkLength > color->palettesize) return 38; in readChunk_tRNS()
4286 for(i = 0; i < chunkLength; i++) color->palette[4 * i + 3] = data[i]; in readChunk_tRNS()
4291 if(chunkLength != 2) return 30; in readChunk_tRNS()
4299 if(chunkLength != 6) return 41; in readChunk_tRNS()
4314 static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) in readChunk_bKGD() argument
4319 if(chunkLength != 1) return 43; in readChunk_bKGD()
4327 if(chunkLength != 2) return 44; in readChunk_bKGD()
4336 if(chunkLength != 6) return 45; in readChunk_bKGD()
4348 static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) in readChunk_tEXt() argument
4359 while(length < chunkLength && data[length] != 0) length++; in readChunk_tEXt()
4372 length = chunkLength < string2_begin ? 0 : chunkLength - string2_begin; in readChunk_tEXt()
4392 const unsigned char* data, size_t chunkLength) in readChunk_zTXt() argument
4405 for(length = 0; length < chunkLength && data[length] != 0; length++) ; in readChunk_zTXt()
4406 if(length + 2 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ in readChunk_zTXt()
4418 if(string2_begin > chunkLength) CERROR_BREAK(error, 75); /*no null termination, corrupt?*/ in readChunk_zTXt()
4420 length = chunkLength - string2_begin; in readChunk_zTXt()
4441 const unsigned char* data, size_t chunkLength) in readChunk_iTXt() argument
4455 if(chunkLength < 5) CERROR_BREAK(error, 30); /*iTXt chunk too short*/ in readChunk_iTXt()
4458 for(length = 0; length < chunkLength && data[length] != 0; length++) ; in readChunk_iTXt()
4459 if(length + 3 >= chunkLength) CERROR_BREAK(error, 75); /*no null termination char, corrupt?*/ in readChunk_iTXt()
4478 for(i = begin; i < chunkLength && data[i] != 0; i++) length++; in readChunk_iTXt()
4489 for(i = begin; i < chunkLength && data[i] != 0; i++) length++; in readChunk_iTXt()
4500 length = chunkLength < begin ? 0 : chunkLength - begin; in readChunk_iTXt()
4533 static unsigned readChunk_tIME(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) in readChunk_tIME() argument
4535 if(chunkLength != 7) return 73; /*invalid tIME chunk size*/ in readChunk_tIME()
4548 static unsigned readChunk_pHYs(LodePNGInfo* info, const unsigned char* data, size_t chunkLength) in readChunk_pHYs() argument
4550 if(chunkLength != 9) return 74; /*invalid pHYs chunk size*/ in readChunk_pHYs()
4591 unsigned chunkLength; in decodeGeneric() local
4598 chunkLength = lodepng_chunk_length(chunk); in decodeGeneric()
4600 if(chunkLength > 2147483647) CERROR_BREAK(state->error, 63); in decodeGeneric()
4602 if((size_t)((chunk - in) + chunkLength + 12) > insize || (chunk + chunkLength + 12) < in) in decodeGeneric()
4613 … if(!ucvector_resize(&idat, oldsize + chunkLength)) CERROR_BREAK(state->error, 83 /*alloc fail*/); in decodeGeneric()
4614 for(i = 0; i < chunkLength; i++) idat.data[oldsize + i] = data[i]; in decodeGeneric()
4627 state->error = readChunk_PLTE(&state->info_png.color, data, chunkLength); in decodeGeneric()
4636 state->error = readChunk_tRNS(&state->info_png.color, data, chunkLength); in decodeGeneric()
4643 state->error = readChunk_bKGD(&state->info_png, data, chunkLength); in decodeGeneric()
4651 state->error = readChunk_tEXt(&state->info_png, data, chunkLength); in decodeGeneric()
4660 … state->error = readChunk_zTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); in decodeGeneric()
4669 … state->error = readChunk_iTXt(&state->info_png, &state->decoder.zlibsettings, data, chunkLength); in decodeGeneric()
4675 state->error = readChunk_tIME(&state->info_png, data, chunkLength); in decodeGeneric()
4680 state->error = readChunk_pHYs(&state->info_png, data, chunkLength); in decodeGeneric()