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 | |
| 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')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/image.c | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2d6ddb9b06a..08fd647074f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-03-04 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Fix misuse of ImageMagick that caused core dump (Bug#13846). | ||
| 4 | * image.c (imagemagick_load_image): Calculate height and width | ||
| 5 | after flattening the image, not before. | ||
| 6 | |||
| 1 | 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru> | 7 | 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 8 | ||
| 3 | * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW. | 9 | * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW. |
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 | { |