diff options
| author | Paul Eggert | 2013-03-04 09:35:29 -0800 |
|---|---|---|
| committer | Paul Eggert | 2013-03-04 09:35:29 -0800 |
| commit | 84ac6f9d211796a458214741bdf9677b92bf1c2a (patch) | |
| tree | 1343e8af8390f4188cb7d5612fc38f743f6231a2 /src/image.c | |
| parent | 8bd104b35b2a51e007e2f1d35cdb4ed00c15ae4a (diff) | |
| download | emacs-84ac6f9d211796a458214741bdf9677b92bf1c2a.tar.gz emacs-84ac6f9d211796a458214741bdf9677b92bf1c2a.zip | |
Fix misuse of ImageMagick that caused core dump.
* image.c (imagemagick_load_image): Calculate height and width
after flattening the image, not before.
Fixes: debbugs:13846
Diffstat (limited to 'src/image.c')
| -rw-r--r-- | src/image.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c index 726b65d7338..2d4e7e731ad 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -7792,11 +7792,6 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 7792 | } | 7792 | } |
| 7793 | } | 7793 | } |
| 7794 | 7794 | ||
| 7795 | /* Finally we are done manipulating the image. Figure out the | ||
| 7796 | resulting width/height and transfer ownership to Emacs. */ | ||
| 7797 | height = MagickGetImageHeight (image_wand); | ||
| 7798 | width = MagickGetImageWidth (image_wand); | ||
| 7799 | |||
| 7800 | /* Set the canvas background color to the frame or specified | 7795 | /* Set the canvas background color to the frame or specified |
| 7801 | background, and flatten the image. Note: as of ImageMagick | 7796 | background, and flatten the image. Note: as of ImageMagick |
| 7802 | 6.6.0, SVG image transparency is not handled properly | 7797 | 6.6.0, SVG image transparency is not handled properly |
| @@ -7813,6 +7808,11 @@ imagemagick_load_image (struct frame *f, struct image *img, | |||
| 7813 | image_wand = new_wand; | 7808 | image_wand = new_wand; |
| 7814 | } | 7809 | } |
| 7815 | 7810 | ||
| 7811 | /* Finally we are done manipulating the image. Figure out the | ||
| 7812 | resulting width/height and transfer ownership to Emacs. */ | ||
| 7813 | height = MagickGetImageHeight (image_wand); | ||
| 7814 | width = MagickGetImageWidth (image_wand); | ||
| 7815 | |||
| 7816 | if (! (width <= INT_MAX && height <= INT_MAX | 7816 | if (! (width <= INT_MAX && height <= INT_MAX |
| 7817 | && check_image_size (f, width, height))) | 7817 | && check_image_size (f, width, height))) |
| 7818 | { | 7818 | { |