diff options
author | Felix Riemann <friemann@gnome.org> | 2020-08-02 20:42:32 +0200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gmail.com> | 2020-11-09 12:20:22 +0000 |
commit | 67615b575a683a7e28387dda65ae8976ac999290 (patch) | |
tree | 031bbd8e79814ab760bddd30cd81330c1e5abf97 /gdk-pixbuf | |
parent | 50387389beda3df666b3ef80811353b35f6d59fd (diff) | |
download | gdk-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.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/io-pnm.c | 6 |
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 |