Always set an error when returning NULL. (453365, Michael Chudobiak)

2007-07-03  Matthias Clasen  <mclasen@redhat.com>

        * io-tiff.c (tiff_image_parse): Always set an error
        when returning NULL.  (453365, Michael Chudobiak)



svn path=/trunk/; revision=18365
This commit is contained in:
Matthias Clasen 2007-07-03 18:22:22 +00:00 committed by Matthias Clasen
parent 22fa07d55d
commit cf12fd0de5
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2007-07-03 Matthias Clasen <mclasen@redhat.com>
* io-tiff.c (tiff_image_parse): Always set an error
when returning NULL. (453365, Michael Chudobiak)
2007-07-03 Matthias Clasen <mclasen@redhat.com>
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Be

View File

@ -199,8 +199,13 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
gint h = height;
(* context->size_func) (&w, &h, context->user_data);
if (w == 0 || h == 0)
if (w == 0 || h == 0) {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Width or height of TIFF image is zero"));
return NULL;
}
}
pixels = g_try_malloc (bytes);