summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Dywan <christian@lanedo.com>2009-08-25 11:58:30 +0200
committerMatthias Clasen <mclasen@redhat.com>2009-08-28 22:36:45 -0400
commit6787e1cfcaaf01343b4785f967dd4864d35f7970 (patch)
tree0831a2ec0605cefaf7438605ea4da85205c2b721
parente9f8e452cddb9de8e5912f1c03cf47c0f76774fa (diff)
downloadgdk-pixbuf-6787e1cfcaaf01343b4785f967dd4864d35f7970.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.
-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 cf8c9ed19..680a20904 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);