summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-ico.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-02-12 23:28:05 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-02-12 23:28:05 +0000
commita9a06ee44e440522eaa56d4f4f300ffe91a5083d (patch)
treeab615c03d69aa578d07bc20dbf64c910018309fb /gdk-pixbuf/io-ico.c
parent67051d64f4f335e8a578602882e215a895614ea5 (diff)
downloadgdk-pixbuf-a9a06ee44e440522eaa56d4f4f300ffe91a5083d.tar.gz
Add a (#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory().
* test-images.h (tiff1_test_3), test-loaders.c (main): Add a (#ifdef 0'ed) test provoking a segfault in TIFFReadDirectory(). * io-ico.c (DecodeHeader): Check that pixbuf could be allocated. * test-images.h (ico_test_2), test-loaders.c (main): Test the previous change. * io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment): Don't write beyond the end of buffer if width % 8 != 0. * io-tga.c (try_preload): Enforce that ctx->hdr->type is one of the supported types, otherwise parse_data_for_row () will not make any progress, leading to an infinite loop.
Diffstat (limited to 'gdk-pixbuf/io-ico.c')
-rw-r--r--gdk-pixbuf/io-ico.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index 0f28ca3e0..bac4d8e90 100644
--- a/gdk-pixbuf/io-ico.c
+++ b/gdk-pixbuf/io-ico.c
@@ -453,6 +453,13 @@ static void DecodeHeader(guchar *Data, gint Bytes,
gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8,
State->Header.width,
State->Header.height);
+ if (!State->pixbuf) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
+ _("Not enough memory to load icon"));
+ return;
+ }
if (State->prepared_func != NULL)
/* Notify the client that we are ready to go */