mirror of
https://github.com/webmproject/libwebp.git
synced 2025-04-05 08:26:51 +02:00
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:
parent
7d8e0896e9
commit
af7fbfd2d9
@ -1326,7 +1326,9 @@ static int ReadTransform(int* const xsize, int const* ysize,
|
|||||||
transform->bits_ = bits;
|
transform->bits_ = bits;
|
||||||
ok = DecodeImageStream(num_colors, /*ysize=*/1, /*is_level0=*/0, dec,
|
ok = DecodeImageStream(num_colors, /*ysize=*/1, /*is_level0=*/0, dec,
|
||||||
&transform->data_);
|
&transform->data_);
|
||||||
ok = ok && ExpandColorMap(num_colors, transform);
|
if (ok && !ExpandColorMap(num_colors, transform)) {
|
||||||
|
return VP8LSetError(dec, VP8_STATUS_OUT_OF_MEMORY);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SUBTRACT_GREEN_TRANSFORM:
|
case SUBTRACT_GREEN_TRANSFORM:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user