* src/image.c (webp_load): Clean up code slightly.
(gif_load): Really release resources on GIF parsing errors.
return true;
gif_error:
- if (!cache)
+ if (pixmap)
+ xfree (pixmap);
+ gif_close (gif, NULL);
+ if (cache)
{
- if (pixmap)
- xfree (pixmap);
- gif_close (gif, NULL);
+ cache->handle = NULL;
+ cache->temp = NULL;
}
return false;
}
if (features.has_animation)
{
/* Animated image. */
- WebPData webp_data;
- webp_data.bytes = contents;
- webp_data.size = size;
int timestamp;
struct anim_cache* cache = anim_get_animation_cache (img->spec);
if (cache->handle)
WebPAnimDecoderDelete (cache->handle);
+ WebPData webp_data;
+ webp_data.bytes = contents;
+ webp_data.size = size;
+
/* Get the width/height of the total image. */
WebPDemuxer* demux = WebPDemux (&webp_data);
cache->width = width = WebPDemuxGetI (demux, WEBP_FF_CANVAS_WIDTH);