mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-12 02:40:34 -08:00
Check decoding results in webp_load before using it
* src/image.c (webp_load): Check whether we were able to decode the image before using it.
This commit is contained in:
parent
10655ce02f
commit
b9c43acdd6
1 changed files with 6 additions and 0 deletions
|
|
@ -9039,6 +9039,12 @@ webp_load (struct frame *f, struct image *img)
|
|||
/* Linear [r0, g0, b0, r1, g1, b1, ...] order. */
|
||||
decoded = WebPDecodeRGB (contents, size, &width, &height);
|
||||
|
||||
if (!decoded)
|
||||
{
|
||||
image_error ("Error when interpreting WebP image data");
|
||||
goto webp_error1;
|
||||
}
|
||||
|
||||
if (!(width <= INT_MAX && height <= INT_MAX
|
||||
&& check_image_size (f, width, height)))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue