diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2009-06-26 18:04:03 -0400 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2009-06-26 18:04:03 -0400 |
commit | d56c2d5edcf109ef1544002d8a78e518f71db06c (patch) | |
tree | 0ef8d112f988eb9d14a4221e743162e1828a2c59 /src/gif.c | |
parent | eb2a6dc7f2fc0ac7cfb95b0d4f93adb363d6310d (diff) |
Image size sanity checks (part 1)
Diffstat (limited to 'src/gif.c')
-rw-r--r-- | src/gif.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -814,7 +814,8 @@ static size_t Gif_do_img_desc(DilloGif *gif, void *Buf, gif->Height = LM_to_uint(buf[6], buf[7]); /* check max image size */ - if (gif->Width * gif->Height > IMAGE_MAX_W * IMAGE_MAX_H) { + if (gif->Width <= 0 || gif->Height <= 0 || + gif->Width > (IMAGE_MAX_W * IMAGE_MAX_H) / gif->Height) { MSG("Gif_do_img_desc: suspicious image size request %ux%u\n", gif->Width, gif->Height); gif->state = 999; |