Pay attention to the libjpeg error code and report OOM errors as such.

2005-08-15  Matthias Clasen  <mclasen@redhat.com>

	* io-jpeg.c (fatal_error_handler): Pay attention to the
	libjpeg error code and report OOM errors as such.  (#312674,
	Tommi Komulainen)
This commit is contained in:
Matthias Clasen
2005-08-15 13:50:27 +00:00
committed by Matthias Clasen
parent 4b5f259ba0
commit e6a81811f9
2 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2005-08-15 Matthias Clasen <mclasen@redhat.com>
* io-jpeg.c (fatal_error_handler): Pay attention to the
libjpeg error code and report OOM errors as such. (#312674,
Tommi Komulainen)
2005-08-13 Matthias Clasen <mclasen@redhat.com>
* === Released 2.8.0 ===

View File

@@ -33,6 +33,7 @@
#include <string.h>
#include <setjmp.h>
#include <jpeglib.h>
#include <jerror.h>
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
@@ -110,7 +111,9 @@ fatal_error_handler (j_common_ptr cinfo)
if (errmgr->error && *errmgr->error == NULL) {
g_set_error (errmgr->error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
cinfo->err->msg_code == JERR_OUT_OF_MEMORY
? GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY
: GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Error interpreting JPEG image file (%s)"),
buffer);
}