diff options
| author | Lars Ingebrigtsen | 2021-12-08 01:38:25 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-12-08 01:38:39 +0100 |
| commit | b9c43acdd6286bf51ab561aabe84e3dcd3a30eff (patch) | |
| tree | c63c6017de556c9aac131fbd90276884c7b7689e /src | |
| parent | 10655ce02f97d474d1fc0c34af9975f36720cc3e (diff) | |
| download | emacs-b9c43acdd6286bf51ab561aabe84e3dcd3a30eff.tar.gz emacs-b9c43acdd6286bf51ab561aabe84e3dcd3a30eff.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c index 65bf22b9814..cd0f3f697f8 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -9039,6 +9039,12 @@ webp_load (struct frame *f, struct image *img) | |||
| 9039 | /* Linear [r0, g0, b0, r1, g1, b1, ...] order. */ | 9039 | /* Linear [r0, g0, b0, r1, g1, b1, ...] order. */ |
| 9040 | decoded = WebPDecodeRGB (contents, size, &width, &height); | 9040 | decoded = WebPDecodeRGB (contents, size, &width, &height); |
| 9041 | 9041 | ||
| 9042 | if (!decoded) | ||
| 9043 | { | ||
| 9044 | image_error ("Error when interpreting WebP image data"); | ||
| 9045 | goto webp_error1; | ||
| 9046 | } | ||
| 9047 | |||
| 9042 | if (!(width <= INT_MAX && height <= INT_MAX | 9048 | if (!(width <= INT_MAX && height <= INT_MAX |
| 9043 | && check_image_size (f, width, height))) | 9049 | && check_image_size (f, width, height))) |
| 9044 | { | 9050 | { |