diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2007-02-07 14:47:36 +0000 |
---|---|---|
committer | Chris Wilson <cpwilson@src.gnome.org> | 2007-02-07 14:47:36 +0000 |
commit | 74747e38c92c406a00d82488d0b4d09f50fb4247 (patch) | |
tree | 351996b9b91a9efea492dc7f9d0572c1e6418fbf /gdk-pixbuf/io-jpeg.c | |
parent | 94e19baaae05bc2ce38c1365a007df7aa172a7e8 (diff) | |
download | gtk+-74747e38c92c406a00d82488d0b4d09f50fb4247.tar.gz |
Set the GError if the image is zero length. (#405327)
2007-02-07 Chris Wilson <chris@chris-wilson.co.uk>
* io-jpeg.c: (gdk_pixbuf__jpeg_image_load),
(gdk_pixbuf__jpeg_image_load_increment): Set the GError
if the image is zero length. (#405327)
svn path=/trunk/; revision=17272
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r-- | gdk-pixbuf/io-jpeg.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c index 52c17d5112..cd11ebc9cf 100644 --- a/gdk-pixbuf/io-jpeg.c +++ b/gdk-pixbuf/io-jpeg.c @@ -307,6 +307,8 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error) g_object_unref (pixbuf); jpeg_destroy_decompress (&cinfo); + + /* error should have been set by fatal_error_handler () */ return NULL; } @@ -715,8 +717,13 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data, height = cinfo->image_height; if (context->size_func) { (* context->size_func) (&width, &height, context->user_data); - if (width == 0 || height == 0) + if (width == 0 || height == 0) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + _("Transformed JPEG has zero width or height.")); return FALSE; + } } for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) { |