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
This commit is contained in:
Matthias Clasen 2007-09-08 05:16:03 +00:00 committed by Matthias Clasen
parent 4fa536dbc1
commit cd82e9786a
2 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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)
{