Commit 50a6924e authored by Paolo Bacchilega's avatar Paolo Bacchilega

jpeg: set the error only once

parent ff5cf9b4
......@@ -48,34 +48,28 @@ static void
fatal_error_handler (j_common_ptr cinfo)
{
struct error_handler_data *errmgr;
char buffer[JMSG_LENGTH_MAX];
errmgr = (struct error_handler_data *) cinfo->err;
if ((errmgr->error != NULL) && (*errmgr->error == NULL)) {
char buffer[JMSG_LENGTH_MAX];
/* Create the message */
(* cinfo->err->format_message) (cinfo, buffer);
/* Create the message */
(* cinfo->err->format_message) (cinfo, buffer);
/* broken check for *error == NULL for robustness against
* crappy JPEG library
*/
if (errmgr->error && *errmgr->error == NULL) {
g_set_error (errmgr->error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
g_set_error (errmgr->error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Error interpreting JPEG image file: %s"),
buffer);
}
siglongjmp (errmgr->setjmp_buffer, 1);
g_assert_not_reached ();
buffer);
siglongjmp (errmgr->setjmp_buffer, 1);
}
}
static void
output_message_handler (j_common_ptr cinfo)
{
/* This method keeps libjpeg from dumping crap to stderr */
/* This method keeps libjpeg from dumping text to stderr */
/* do nothing */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment