1
Fork 0
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:
Lars Ingebrigtsen 2021-12-08 01:38:25 +01:00
parent 10655ce02f
commit b9c43acdd6

View file

@ -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)))
{