diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-12 23:28:05 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-12 23:28:05 +0000 |
commit | a9a06ee44e440522eaa56d4f4f300ffe91a5083d (patch) | |
tree | ab615c03d69aa578d07bc20dbf64c910018309fb /gdk-pixbuf/io-ico.c | |
parent | 67051d64f4f335e8a578602882e215a895614ea5 (diff) | |
download | gtk+-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.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index 0f28ca3e0c..bac4d8e907 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 */ |