aboutsummaryrefslogtreecommitdiff
path: root/src/gif.c
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2013-07-30 18:41:30 +0200
committerSebastian Geerken <devnull@localhost>2013-07-30 18:41:30 +0200
commitff6dc66d7ff225960cb52fb6df95461bcec9f0d4 (patch)
tree758f9a2e55b2c48e3ef9b4cec89dd0402209c734 /src/gif.c
parent97b54265687beaddd0b588b18994c68fe770a7d5 (diff)
parent0d0e61f454008dc27d49a3b6a5f1a97f9f81297a (diff)
Merge with main repo.
Diffstat (limited to 'src/gif.c')
-rw-r--r--src/gif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gif.c b/src/gif.c
index 69fcf5d3..7ce1e110 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -287,13 +287,15 @@ static inline size_t Gif_data_blocks(const uchar_t *Buf, size_t BSize)
*/
static inline size_t Gif_do_generic_ext(const uchar_t *Buf, size_t BSize)
{
- size_t Size = Buf[0] + 1, DSize;
+
+ size_t Size = Buf[0] + 1, /* (uchar_t + 1) can't overflow size_t */
+ DSize;
/* The Block size (the first byte) is supposed to be a specific size
* for each extension... we don't check.
*/
- if (Buf[0] > BSize)
+ if (Size > BSize)
return 0;
DSize = Gif_data_blocks(Buf + Size, BSize - Size);
if (!DSize)