summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Riemann <friemann@gnome.org>2020-08-02 20:42:32 +0200
committerEmmanuele Bassi <ebassi@gmail.com>2020-11-09 12:20:22 +0000
commit67615b575a683a7e28387dda65ae8976ac999290 (patch)
tree031bbd8e79814ab760bddd30cd81330c1e5abf97
parent50387389beda3df666b3ef80811353b35f6d59fd (diff)
downloadgdk-pixbuf-67615b575a683a7e28387dda65ae8976ac999290.tar.gz
PNM: Generate an error if no pixbuf could be produced
This is expected by the loader API which trips over an assertion otherwise. Partially loaded images still work while images that are too truncated fail gracefully. Fixes #111.
-rw-r--r--gdk-pixbuf/io-pnm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c
index 91e7dca67..856501ae5 100644
--- a/gdk-pixbuf/io-pnm.c
+++ b/gdk-pixbuf/io-pnm.c
@@ -873,6 +873,12 @@ gdk_pixbuf__pnm_image_stop_load (gpointer data,
if (context->pixbuf)
g_object_unref (context->pixbuf);
+ else {
+ g_set_error_literal (error, GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Premature end-of-file encountered"));
+ retval = FALSE;
+ }
#if 0
/* We should ignore trailing newlines and we can't