From ae62c55cecfecfa2f433b20b069df9f3b475742b Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 14 Sep 2003 23:00:53 +0000 Subject: [project @ 2003-09-14 23:00:53 by bursa] Check for errors from Anim_DecompressAligned. svn path=/import/netsurf/; revision=292 --- riscos/gif.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'riscos') diff --git a/riscos/gif.c b/riscos/gif.c index c44f99f08..3eceb9db7 100644 --- a/riscos/gif.c +++ b/riscos/gif.c @@ -69,7 +69,6 @@ int nsgif_convert(struct content *c, unsigned int iwidth, unsigned int iheight) LOG(("Failed to create sprite")); Anim_Destroy(&a); - xfree(area); return 1; } c->data.gif.sprite_area = area; @@ -79,15 +78,25 @@ int nsgif_convert(struct content *c, unsigned int iwidth, unsigned int iheight) img = (pixel*)header + header->image; mask = (pixel*)header + header->mask; - Anim_DecompressAligned(f->pImageData, f->nImageSize, - a->nWidth, a->nHeight, img); + if (!Anim_DecompressAligned(f->pImageData, f->nImageSize, + a->nWidth, a->nHeight, img)) { + LOG(("Anim_DecompressAligned image failed")); + Anim_Destroy(&a); + xfree(area); + return 1; + } if(f->pMaskData) { int i,n = header->mask - header->image; - Anim_DecompressAligned(f->pMaskData, f->nMaskSize, - a->nWidth, a->nHeight, mask); + if (!Anim_DecompressAligned(f->pMaskData, f->nMaskSize, + a->nWidth, a->nHeight, mask)) { + LOG(("Anim_DecompressAligned mask failed")); + Anim_Destroy(&a); + xfree(area); + return 1; + } for(i=0; i