vp8l_dec,ReadTransform: improve error status reporting

ExpandColorMap() can fail due to a memory allocation failure.

Found by Nallocfuzz (https://github.com/catenacyber/nallocfuzz).

Change-Id: I868c5db2fee18e876f4aa3b63e744d7297d1a91b
This commit is contained in:
James Zern 2023-07-21 23:20:52 +00:00
parent 7d8e0896e9
commit af7fbfd2d9

View File

@ -1326,7 +1326,9 @@ static int ReadTransform(int* const xsize, int const* ysize,
transform->bits_ = bits;
ok = DecodeImageStream(num_colors, /*ysize=*/1, /*is_level0=*/0, dec,
&transform->data_);
ok = ok && ExpandColorMap(num_colors, transform);
if (ok && !ExpandColorMap(num_colors, transform)) {
return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY);
}
break;
}
case SUBTRACT_GREEN_TRANSFORM: