diff options
| author | Jason Rumney | 2009-03-04 13:02:54 +0000 |
|---|---|---|
| committer | Jason Rumney | 2009-03-04 13:02:54 +0000 |
| commit | 10ea2b82aa4a6509a8f97f43918a6047684857f4 (patch) | |
| tree | 32722844006e742db293e8308e894fd87a69bc5f /src | |
| parent | 75aaefe8c161e7ac0eca7029206087e428f0cffe (diff) | |
| download | emacs-10ea2b82aa4a6509a8f97f43918a6047684857f4.tar.gz emacs-10ea2b82aa4a6509a8f97f43918a6047684857f4.zip | |
(xbm_read_bitmap_data, png_load, svg_load_image):
Log an error message if check_image_size failed.
(xpm_load_image, pbm_load, jpeg_load, tiff_load, gif_load)
(gs_load): Mention max-image-size in size error message.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/image.c | 30 |
2 files changed, 26 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3af2b81e191..2adea67735e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-03-04 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * image.c (xbm_read_bitmap_data, png_load, svg_load_image): | ||
| 4 | Log an error message if check_image_size failed. | ||
| 5 | (xpm_load_image, pbm_load, jpeg_load, tiff_load, gif_load) | ||
| 6 | (gs_load): Mention max-image-size in size error message. | ||
| 7 | |||
| 1 | 2009-03-02 Eli Zaretskii <eliz@gnu.org> | 8 | 2009-03-02 Eli Zaretskii <eliz@gnu.org> |
| 2 | 9 | ||
| 3 | * callproc.c (Fcall_process): Bind inhibit-modification-hooks to t | 10 | * callproc.c (Fcall_process): Bind inhibit-modification-hooks to t |
diff --git a/src/image.c b/src/image.c index 3323a68d33f..fa8c3ea9cda 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -2992,7 +2992,10 @@ xbm_read_bitmap_data (f, contents, end, width, height, data) | |||
| 2992 | } | 2992 | } |
| 2993 | 2993 | ||
| 2994 | if (!check_image_size (f, *width, *height)) | 2994 | if (!check_image_size (f, *width, *height)) |
| 2995 | goto failure; | 2995 | { |
| 2996 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); | ||
| 2997 | goto failure; | ||
| 2998 | } | ||
| 2996 | else if (data == NULL) | 2999 | else if (data == NULL) |
| 2997 | goto success; | 3000 | goto success; |
| 2998 | 3001 | ||
| @@ -4202,7 +4205,7 @@ xpm_load_image (f, img, contents, end) | |||
| 4202 | 4205 | ||
| 4203 | if (!check_image_size (f, width, height)) | 4206 | if (!check_image_size (f, width, height)) |
| 4204 | { | 4207 | { |
| 4205 | image_error ("Invalid image size", Qnil, Qnil); | 4208 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 4206 | goto failure; | 4209 | goto failure; |
| 4207 | } | 4210 | } |
| 4208 | 4211 | ||
| @@ -5543,7 +5546,7 @@ pbm_load (f, img) | |||
| 5543 | 5546 | ||
| 5544 | if (!check_image_size (f, width, height)) | 5547 | if (!check_image_size (f, width, height)) |
| 5545 | { | 5548 | { |
| 5546 | image_error ("Invalid image size", Qnil, Qnil); | 5549 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 5547 | goto error; | 5550 | goto error; |
| 5548 | } | 5551 | } |
| 5549 | 5552 | ||
| @@ -6079,8 +6082,10 @@ png_load (f, img) | |||
| 6079 | &interlace_type, NULL, NULL); | 6082 | &interlace_type, NULL, NULL); |
| 6080 | 6083 | ||
| 6081 | if (!check_image_size (f, width, height)) | 6084 | if (!check_image_size (f, width, height)) |
| 6082 | goto error; | 6085 | { |
| 6083 | 6086 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); | |
| 6087 | goto error; | ||
| 6088 | } | ||
| 6084 | /* If image contains simply transparency data, we prefer to | 6089 | /* If image contains simply transparency data, we prefer to |
| 6085 | construct a clipping mask. */ | 6090 | construct a clipping mask. */ |
| 6086 | if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) | 6091 | if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) |
| @@ -6787,7 +6792,7 @@ jpeg_load (f, img) | |||
| 6787 | 6792 | ||
| 6788 | if (!check_image_size (f, width, height)) | 6793 | if (!check_image_size (f, width, height)) |
| 6789 | { | 6794 | { |
| 6790 | image_error ("Invalid image size", Qnil, Qnil); | 6795 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 6791 | longjmp (mgr.setjmp_buffer, 2); | 6796 | longjmp (mgr.setjmp_buffer, 2); |
| 6792 | } | 6797 | } |
| 6793 | 6798 | ||
| @@ -7238,7 +7243,7 @@ tiff_load (f, img) | |||
| 7238 | 7243 | ||
| 7239 | if (!check_image_size (f, width, height)) | 7244 | if (!check_image_size (f, width, height)) |
| 7240 | { | 7245 | { |
| 7241 | image_error ("Invalid image size", Qnil, Qnil); | 7246 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 7242 | fn_TIFFClose (tiff); | 7247 | fn_TIFFClose (tiff); |
| 7243 | UNGCPRO; | 7248 | UNGCPRO; |
| 7244 | return 0; | 7249 | return 0; |
| @@ -7577,7 +7582,7 @@ gif_load (f, img) | |||
| 7577 | /* Before reading entire contents, check the declared image size. */ | 7582 | /* Before reading entire contents, check the declared image size. */ |
| 7578 | if (!check_image_size (f, gif->SWidth, gif->SHeight)) | 7583 | if (!check_image_size (f, gif->SWidth, gif->SHeight)) |
| 7579 | { | 7584 | { |
| 7580 | image_error ("Invalid image size", Qnil, Qnil); | 7585 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 7581 | fn_DGifCloseFile (gif); | 7586 | fn_DGifCloseFile (gif); |
| 7582 | UNGCPRO; | 7587 | UNGCPRO; |
| 7583 | return 0; | 7588 | return 0; |
| @@ -7620,7 +7625,7 @@ gif_load (f, img) | |||
| 7620 | 7625 | ||
| 7621 | if (!check_image_size (f, width, height)) | 7626 | if (!check_image_size (f, width, height)) |
| 7622 | { | 7627 | { |
| 7623 | image_error ("Invalid image size", Qnil, Qnil); | 7628 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 7624 | fn_DGifCloseFile (gif); | 7629 | fn_DGifCloseFile (gif); |
| 7625 | UNGCPRO; | 7630 | UNGCPRO; |
| 7626 | return 0; | 7631 | return 0; |
| @@ -8047,7 +8052,10 @@ svg_load_image (f, img, contents, size) | |||
| 8047 | 8052 | ||
| 8048 | fn_rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); | 8053 | fn_rsvg_handle_get_dimensions (rsvg_handle, &dimension_data); |
| 8049 | if (! check_image_size (f, dimension_data.width, dimension_data.height)) | 8054 | if (! check_image_size (f, dimension_data.width, dimension_data.height)) |
| 8050 | goto rsvg_error; | 8055 | { |
| 8056 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); | ||
| 8057 | goto rsvg_error; | ||
| 8058 | } | ||
| 8051 | 8059 | ||
| 8052 | /* We can now get a valid pixel buffer from the svg file, if all | 8060 | /* We can now get a valid pixel buffer from the svg file, if all |
| 8053 | went ok. */ | 8061 | went ok. */ |
| @@ -8320,7 +8328,7 @@ gs_load (f, img) | |||
| 8320 | 8328 | ||
| 8321 | if (!check_image_size (f, img->width, img->height)) | 8329 | if (!check_image_size (f, img->width, img->height)) |
| 8322 | { | 8330 | { |
| 8323 | image_error ("Invalid image size", Qnil, Qnil); | 8331 | image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); |
| 8324 | return 0; | 8332 | return 0; |
| 8325 | } | 8333 | } |
| 8326 | 8334 | ||