summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-01-06 22:44:16 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-01-06 22:44:16 -0500
commit9fc436d810d12f75387bf8bfd440ef6db460500a (patch)
tree3b8fbcf420d5b7a3eab1c954754a7565eb4cf197 /gdk-pixbuf
parente466b0e93e6b89f28e44c7e7ba0b793e7275992c (diff)
downloadgdk-pixbuf-9fc436d810d12f75387bf8bfd440ef6db460500a.tar.gz
Setup libjpeg error handlers early enough
See bug 606068 for details.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-jpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index c2c5ab9f3..cc1db97e6 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -656,6 +656,13 @@ gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
context->src_initialized = FALSE;
context->in_output = FALSE;
+ /* From jpeglib.h: "NB: you must set up the error-manager
+ * BEFORE calling jpeg_create_xxx". */
+ context->cinfo.err = jpeg_std_error (&context->jerr.pub);
+ context->jerr.pub.error_exit = fatal_error_handler;
+ context->jerr.pub.output_message = output_message_handler;
+ context->jerr.error = error;
+
/* create libjpeg structures */
jpeg_create_decompress (&context->cinfo);
@@ -668,14 +675,7 @@ gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
return NULL;
}
memset (context->cinfo.src, 0, sizeof (my_source_mgr));
-
- src = (my_src_ptr) context->cinfo.src;
- context->cinfo.err = jpeg_std_error (&context->jerr.pub);
- context->jerr.pub.error_exit = fatal_error_handler;
- context->jerr.pub.output_message = output_message_handler;
- context->jerr.error = error;
-
src = (my_src_ptr) context->cinfo.src;
src->pub.init_source = init_source;
src->pub.fill_input_buffer = fill_input_buffer;