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:
Vikas Arora 2012-06-08 14:29:26 +05:30
parent 0bceae488e
commit eaee9e79f7

View File

@ -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);
}