summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-ico.c
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-02-10 21:06:15 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-02-10 21:06:15 +0000
commit73aa2bfe050ec9c1ae4cb2e913d46f550ce19668 (patch)
tree170366183831f6d7981efe75e87787910915c0c1 /gdk-pixbuf/io-ico.c
parent8846275862f6362bfd211c53cf21ebe826da01c3 (diff)
downloadgdk-pixbuf-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.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index 412ea319d..0f28ca3e0 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. */