Skip to content

Commit

Permalink
Fixed a memory leak in the GIF decoder
Browse files Browse the repository at this point in the history
Fixes issue #18
  • Loading branch information
jsummers committed Apr 18, 2017
1 parent ca3356e commit 5fa4864
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/imagew-gif.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ IW_IMPL(int) iw_read_gif_file(struct iw_context *ctx, struct iw_iodescr *iodescr
done:
if(!retval) {
iw_set_error(ctx,"Failed to read GIF file");
// If we didn't call iw_set_input_image, 'img' still belongs to us,
// so free its contents.
iw_free(ctx, img.pixels);
}

if(rctx) {
Expand Down

0 comments on commit 5fa4864

Please sign in to comment.