summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-09-08 05:16:03 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-09-08 05:16:03 +0000
commitcd82e9786a180be227fbb14cfb70371cc9e757f9 (patch)
tree461821ef2c83cff52fb82aac20c5bf5602acce2c /gdk-pixbuf
parent4fa536dbc1bf42f02aa7caca56b8caf0f379f981 (diff)
downloadgtk+-cd82e9786a180be227fbb14cfb70371cc9e757f9.tar.gz
Fix some possible crashes. (#468832, Michal Luczaj)
2007-09-08 Matthias Clasen <mclasen@redhat.com> * io-ani.c: Fix some possible crashes. (#468832, Michal Luczaj) svn path=/trunk/; revision=18759
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog4
-rw-r--r--gdk-pixbuf/io-ani.c33
2 files changed, 37 insertions, 0 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 17c289d4e0..6cf3957d43 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,7 @@
+2007-09-08 Matthias Clasen <mclasen@redhat.com>
+
+ * io-ani.c: Fix some possible crashes. (#468832, Michal Luczaj)
+
2007-09-07 Matthias Clasen <mclasen@redhat.com>
* io-tga.c (gdk_pixbuf__tga_stop_load): Handle pbuf
diff --git a/gdk-pixbuf/io-ani.c b/gdk-pixbuf/io-ani.c
index 6ac343c0c6..65e560b8ba 100644
--- a/gdk-pixbuf/io-ani.c
+++ b/gdk-pixbuf/io-ani.c
@@ -398,6 +398,15 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
_("Malformed chunk in animation"));
return FALSE;
}
+ if (!context->animation)
+ {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid header in animation"));
+ return FALSE;
+ }
+
context->animation->total_time = 0;
for (i = 0; i < context->NumSteps; i++)
{
@@ -415,6 +424,14 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
_("Malformed chunk in animation"));
return FALSE;
}
+ if (!context->animation)
+ {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid header in animation"));
+ return FALSE;
+ }
for (i = 0; i < context->NumSteps; i++)
{
context->animation->sequence[i] = read_int32 (context);
@@ -430,6 +447,14 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
}
else if (context->chunk_id == TAG_INAM)
{
+ if (!context->animation)
+ {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid header in animation"));
+ return FALSE;
+ }
context->title = g_try_malloc (context->chunk_size + 1);
if (!context->title)
{
@@ -449,6 +474,14 @@ ani_load_chunk (AniLoaderContext *context, GError **error)
}
else if (context->chunk_id == TAG_IART)
{
+ if (!context->animation)
+ {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Invalid header in animation"));
+ return FALSE;
+ }
context->author = g_try_malloc (context->chunk_size + 1);
if (!context->author)
{