summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-ico.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdk-pixbuf/io-ico.c')
-rw-r--r--gdk-pixbuf/io-ico.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index b7945dec2..e5444640c 100644
--- a/gdk-pixbuf/io-ico.c
+++ b/gdk-pixbuf/io-ico.c
@@ -326,7 +326,9 @@ static void DecodeHeader(guchar *Data, gint Bytes,
for (l = State->entries; l != NULL; l = g_list_next (l)) {
entry = l->data;
- if (entry->DIBoffset < 0) {
+ /* We check whether the HeaderSize (int) would overflow */
+ if (entry->DIBoffset > INT_MAX - INFOHEADER_SIZE)
+ {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,