summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-08-15 13:50:27 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-08-15 13:50:27 +0000
commite6a81811f97829b605b0a86a488e2d25006b2e95 (patch)
tree11cf5f1b8b1bd14fa5f0ccc947f510f0af32df58 /gdk-pixbuf/io-jpeg.c
parent4b5f259ba03131f21cc820331731d166fd0d3f56 (diff)
downloadgtk+-e6a81811f97829b605b0a86a488e2d25006b2e95.tar.gz
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)
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 7f21594760..fe49c256f0 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -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);
}