mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Bug-Fix: Decode small (less than 32 bytes) images.
ParseVP8X was checking for presence of extra 20 bytes (after RIFF header). This check should not be executed for non-mux (non-VP8X) images. Change-Id: I3fc89fa098ac0a53102e7bbf6c291269817c8e47
This commit is contained in:
parent
0bceae488e
commit
eaee9e79f7
@ -96,7 +96,7 @@ static VP8StatusCode ParseVP8X(const uint8_t** data, size_t* data_size,
|
||||
|
||||
*found_vp8x = 0;
|
||||
|
||||
if (*data_size < vp8x_size) {
|
||||
if (*data_size < CHUNK_HEADER_SIZE) {
|
||||
return VP8_STATUS_NOT_ENOUGH_DATA; // Insufficient data.
|
||||
}
|
||||
|
||||
@ -105,6 +105,12 @@ static VP8StatusCode ParseVP8X(const uint8_t** data, size_t* data_size,
|
||||
if (chunk_size != VP8X_CHUNK_SIZE) {
|
||||
return VP8_STATUS_BITSTREAM_ERROR; // Wrong chunk size.
|
||||
}
|
||||
|
||||
// Verify if enough data is available to validate the VP8X chunk.
|
||||
if (*data_size < vp8x_size) {
|
||||
return VP8_STATUS_NOT_ENOUGH_DATA; // Insufficient data.
|
||||
}
|
||||
|
||||
if (flags != NULL) {
|
||||
*flags = get_le32(*data + 8);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user