diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-10 21:06:15 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-02-10 21:06:15 +0000 |
commit | 73aa2bfe050ec9c1ae4cb2e913d46f550ce19668 (patch) | |
tree | 170366183831f6d7981efe75e87787910915c0c1 /gdk-pixbuf/io-ico.c | |
parent | 8846275862f6362bfd211c53cf21ebe826da01c3 (diff) | |
download | gtk+-73aa2bfe050ec9c1ae4cb2e913d46f550ce19668.tar.gz |
Enable some tests which should work now.
* test-loaders.c (main): Enable some tests which should work
now.
* io-wbmp.c (gdk_pixbuf__wbmp_image_load_increment): Detect
invalid image dimensions and insufficient memory.
* io-tga.c (try_preload): Detect invalid image dimensions.
(gdk_pixbuf__tga_stop_load): Don't try to unref NULL pointers.
* io-ico.c (DecodeHeader): Detect some invalid headers and
don't segfault.
Diffstat (limited to 'gdk-pixbuf/io-ico.c')
-rw-r--r-- | gdk-pixbuf/io-ico.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c index 412ea319da..0f28ca3e0c 100644 --- a/gdk-pixbuf/io-ico.c +++ b/gdk-pixbuf/io-ico.c @@ -295,7 +295,15 @@ static void DecodeHeader(guchar *Data, gint Bytes, Ptr += 16; } - + + if (State->DIBoffset < 0) { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + _("Invalid header in icon")); + return; + } + /* We now have a winner, pointed to in State->DIBoffset, so we know how many bytes are in the "header" part. */ |