mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 15:32:53 +01:00
Rectify the Chunk parsing logic.
For odd-sized chunk-payload, there's one Byte padding at the end to make the next chunk start at even-address. The chunk-skip logic needs to be updated to handle such cases. Change-Id: I8939ed07584a6195092fbe703eb0ea711fa5f153
This commit is contained in:
parent
b8634f7d8f
commit
f07b2138cd
@ -131,7 +131,8 @@ VP8StatusCode WebPParseOptionalChunks(const uint8_t** data, uint32_t* data_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
chunk_size = get_le32(buf + TAG_SIZE);
|
chunk_size = get_le32(buf + TAG_SIZE);
|
||||||
cur_skip_size = CHUNK_HEADER_SIZE + chunk_size;
|
// For odd-sized chunk-payload, there's one Byte padding at the end.
|
||||||
|
cur_skip_size = (CHUNK_HEADER_SIZE + chunk_size + 1) & ~1;
|
||||||
|
|
||||||
// Check that total bytes skipped along with current chunk size
|
// Check that total bytes skipped along with current chunk size
|
||||||
// does not exceed riff_size.
|
// does not exceed riff_size.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user