Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
file-gif-load: Fix incorrect out-of-input-bits condition (#695513)
GetCode() erroneously assumes that it has run out of input bits, because
it's off by 1 in its size calculation. At the end of the block, if the
End-of-Information code is exactly at the block boundary, it calculates
that it needs to read an extra bit, and tries to read beyond the end of
the block. It fails then, and the End-of-Information code is not
processed, and other warnings/errors are generated.
  • Loading branch information
muks committed Mar 12, 2013
1 parent 3a0daf5 commit f86655b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plug-ins/common/file-gif-load.c
Expand Up @@ -685,7 +685,7 @@ GetCode (FILE *fd,
return 0;
}

while ((curbit + code_size) >= lastbit)
while ((curbit + code_size) > lastbit)
{
if (done)
{
Expand Down

0 comments on commit f86655b

Please sign in to comment.