diff options
author | James Bursa <james@netsurf-browser.org> | 2003-09-14 23:00:53 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-09-14 23:00:53 +0000 |
commit | ae62c55cecfecfa2f433b20b069df9f3b475742b (patch) | |
tree | 18bf69878b65075e2dda4a5a005761c6ed367c50 | |
parent | eeb805497da31fa26be6147d468ac1f1a729b636 (diff) | |
download | netsurf-ae62c55cecfecfa2f433b20b069df9f3b475742b.tar.gz netsurf-ae62c55cecfecfa2f433b20b069df9f3b475742b.tar.bz2 |
[project @ 2003-09-14 23:00:53 by bursa]
Check for errors from Anim_DecompressAligned.
svn path=/import/netsurf/; revision=292
-rw-r--r-- | riscos/gif.c | 19 |
1 files changed, 14 insertions, 5 deletions
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<n; i++) if(!mask[i]) { |