mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-31 10:25:46 +01:00 
			
		
		
		
	Mux: fix a scenario with bad ANMF/FRGM size
When a ANMF/FRGM chunk size (read from file) is smaller than ANMF/FRGM header size (which is constant and implicit), the parser should report an error. Change-Id: I91d71889937f5133a97f1e83d5254cb2d7f37028
This commit is contained in:
		| @@ -92,6 +92,9 @@ static int MuxImageParse(const WebPChunk* const chunk, int copy_data, | |||||||
|     const size_t hdr_size = (chunk->tag_ == kChunks[IDX_ANMF].tag) ? |     const size_t hdr_size = (chunk->tag_ == kChunks[IDX_ANMF].tag) ? | ||||||
|         ANMF_CHUNK_SIZE : FRGM_CHUNK_SIZE; |         ANMF_CHUNK_SIZE : FRGM_CHUNK_SIZE; | ||||||
|     const WebPData temp = { bytes, hdr_size }; |     const WebPData temp = { bytes, hdr_size }; | ||||||
|  |     // Each of ANMF and FRGM chunk contain a header at the beginning. So, its | ||||||
|  |     // size should at least be 'hdr_size'. | ||||||
|  |     if (size < hdr_size) goto Fail; | ||||||
|     ChunkAssignData(&subchunk, &temp, copy_data, chunk->tag_); |     ChunkAssignData(&subchunk, &temp, copy_data, chunk->tag_); | ||||||
|   } |   } | ||||||
|   ChunkSetNth(&subchunk, &wpi->header_, 1); |   ChunkSetNth(&subchunk, &wpi->header_, 1); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user