changeset 1312:f5a186303478

only show JPEG errors if prefs.show_msg set
author corvid <corvid@lavabit.com>
date Fri, 11 Sep 2009 01:56:58 +0000
parents 5981bd61a69c
children e581a86828b7
files src/jpeg.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/jpeg.c	Fri Sep 11 01:26:04 2009 +0000
+++ b/src/jpeg.c	Fri Sep 11 01:56:58 2009 +0000
@@ -87,11 +87,14 @@
 /* this is the routine called by libjpeg when it detects an error. */
 METHODDEF(void) Jpeg_errorexit (j_common_ptr cinfo)
 {
-   DilloJpeg *jpeg = ((my_source_mgr *) ((j_decompress_ptr) cinfo)->src)->jpeg;
-   MSG_WARN("\"%s\": ", URL_STR(jpeg->url));
    /* display message and return to setjmp buffer */
    my_error_ptr myerr = (my_error_ptr) cinfo->err;
-   (*cinfo->err->output_message) (cinfo);
+   if (prefs.show_msg) {
+      DilloJpeg *jpeg =
+                     ((my_source_mgr *) ((j_decompress_ptr) cinfo)->src)->jpeg;
+      MSG_WARN("\"%s\": ", URL_STR(jpeg->url));
+      (*cinfo->err->output_message) (cinfo);
+   }
    longjmp(myerr->setjmp_buffer, 1);
 }