[gdk-pixbuf] jpeg: Prevent crashes when stopping loading broken files
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] jpeg: Prevent crashes when stopping loading broken files
- Date: Tue, 5 Dec 2017 10:40:11 +0000 (UTC)
commit 9aa37e998282bcf6b2ac0705345ab2017d4b2c9b
Author: Bastien Nocera <hadess hadess net>
Date: Tue Dec 5 10:40:44 2017 +0100
jpeg: Prevent crashes when stopping loading broken files
A follow-up from commit b99e04f, to avoid trying to access pixel data in
a pixbuf that doesn't exist any more.
gdk-pixbuf/io-jpeg.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 1cd3d30..6d9169f 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -851,7 +851,8 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
cinfo = &context->cinfo;
/* Try to finish loading truncated files */
- if (cinfo->output_scanline < cinfo->output_height) {
+ if (context->pixbuf &&
+ cinfo->output_scanline < cinfo->output_height) {
my_src_ptr src = (my_src_ptr) cinfo->src;
/* But only if there's enough buffer space left */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]