mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-06 20:12:53 +01:00
fix read-overflow while parsing VP8X chunk
The available size was not checked before parsing the VP8X data BUG=oss-fuzz:9100,oss-fuzz:9123,webp:512 Change-Id: I0143cc4554883c1015e2f084a0e371229e04a8ca (cherry picked from commit 95fd65070662e01cc9170c4444f5c0859a710097) (cherry picked from commit c0226fd91cbe5fa6fbf5a68dcc9acc9dbe1e358e)
This commit is contained in:
parent
35de4be698
commit
2cb7701480
@ -264,6 +264,7 @@ WebPMux* WebPMuxCreateInternal(const WebPData* bitstream, int copy_data,
|
|||||||
chunk_list = MuxGetChunkListFromId(mux, id); // List to add this chunk.
|
chunk_list = MuxGetChunkListFromId(mux, id); // List to add this chunk.
|
||||||
if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err;
|
if (ChunkSetNth(&chunk, chunk_list, 0) != WEBP_MUX_OK) goto Err;
|
||||||
if (id == WEBP_CHUNK_VP8X) { // grab global specs
|
if (id == WEBP_CHUNK_VP8X) { // grab global specs
|
||||||
|
if (data_size < CHUNK_HEADER_SIZE + VP8X_CHUNK_SIZE) goto Err;
|
||||||
mux->canvas_width_ = GetLE24(data + 12) + 1;
|
mux->canvas_width_ = GetLE24(data + 12) + 1;
|
||||||
mux->canvas_height_ = GetLE24(data + 15) + 1;
|
mux->canvas_height_ = GetLE24(data + 15) + 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user