From e6a81811f97829b605b0a86a488e2d25006b2e95 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Aug 2005 13:50:27 +0000 Subject: [PATCH] Pay attention to the libjpeg error code and report OOM errors as such. 2005-08-15 Matthias Clasen * io-jpeg.c (fatal_error_handler): Pay attention to the libjpeg error code and report OOM errors as such. (#312674, Tommi Komulainen) --- gdk-pixbuf/ChangeLog | 6 ++++++ gdk-pixbuf/io-jpeg.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 80a6a0d944..c69f58bd37 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +2005-08-15 Matthias Clasen + + * 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 * === Released 2.8.0 === 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 #include #include +#include #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); }