[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master b9c43ac: Check decoding results in webp_load before using it
From: |
Lars Ingebrigtsen |
Subject: |
master b9c43ac: Check decoding results in webp_load before using it |
Date: |
Tue, 7 Dec 2021 19:38:44 -0500 (EST) |
branch: master
commit b9c43acdd6286bf51ab561aabe84e3dcd3a30eff
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
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.
---
src/image.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/image.c b/src/image.c
index 65bf22b..cd0f3f6 100644
--- a/src/image.c
+++ b/src/image.c
@@ -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)))
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master b9c43ac: Check decoding results in webp_load before using it,
Lars Ingebrigtsen <=