Skip to content
Permalink
Browse files

Fixed a GIF decoding bug (divide by zero)

Fixes issue #15
  • Loading branch information...
jsummers committed Apr 14, 2017
1 parent 8656405 commit ca3356eb49fee03e2eaf6b6aff826988c1122d93
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/imagew-gif.c
@@ -614,6 +614,10 @@ static int iwgif_read_image(struct iwgifrcontext *rctx)

rctx->image_width = (int)iw_get_ui16le(&rctx->rbuf[4]);
rctx->image_height = (int)iw_get_ui16le(&rctx->rbuf[6]);
if(rctx->image_width<1 || rctx->image_height<1) {
iw_set_error(rctx->ctx, "Invalid image dimensions");
goto done;
}

rctx->interlaced = (int)((rctx->rbuf[8]>>6)&0x01);

0 comments on commit ca3356e

Please sign in to comment.
You can’t perform that action at this time.