summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorChristian Dywan <christian@lanedo.com>2009-08-25 11:58:30 +0200
committerChristian Dywan <christian@twotoasts.de>2009-08-25 12:01:54 +0200
commitc91cb2f71a33445fa3d8cf8da214cdc0212918ed (patch)
tree1e21d55e019c48451a0b9324fa7db0ffee9cfa22 /gdk-pixbuf
parent33c70e9b52088b107e7b6e14f57a23cf3fe666e6 (diff)
downloadgtk+-c91cb2f71a33445fa3d8cf8da214cdc0212918ed.tar.gz
BugĀ 592901 - Crash in JPEG pixbuf loader instead of error
Initialize the error structure early enough to ensure that it propagates properly in the case of an error. Patch by Nokia.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-jpeg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index cf8c9ed195..680a209041 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -468,7 +468,6 @@ gdk_pixbuf__jpeg_image_load (FILE *f, GError **error)
cinfo.err = jpeg_std_error (&jerr.pub);
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
-
jerr.error = error;
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
@@ -1190,11 +1189,11 @@ real_save_jpeg (GdkPixbuf *pixbuf,
}
/* set up error handling */
+ cinfo.err = jpeg_std_error (&(jerr.pub));
jerr.pub.error_exit = fatal_error_handler;
jerr.pub.output_message = output_message_handler;
jerr.error = error;
- cinfo.err = jpeg_std_error (&(jerr.pub));
if (sigsetjmp (jerr.setjmp_buffer, 1)) {
jpeg_destroy_compress (&cinfo);
g_free (buf);