[gimp/gimp-2-8] file-gif-load: Fix incorrect out-of-input-bits condition (#695513)
- From: Mukund Sivaraman <muks src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] file-gif-load: Fix incorrect out-of-input-bits condition (#695513)
- Date: Tue, 12 Mar 2013 07:46:02 +0000 (UTC)
commit af88c4a6c943eb5db04fa3eea00befb7442a1e58
Author: Mukund Sivaraman <muks banu com>
Date: Tue Mar 12 13:08:14 2013 +0530
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.
(cherry picked from commit f86655bb1fcf356524c1894096f4866633cc7666)
plug-ins/common/file-gif-load.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c
index 0bb9bc4..c1ea2a0 100644
--- a/plug-ins/common/file-gif-load.c
+++ b/plug-ins/common/file-gif-load.c
@@ -684,7 +684,7 @@ GetCode (FILE *fd,
return 0;
}
- while ((curbit + code_size) >= lastbit)
+ while ((curbit + code_size) > lastbit)
{
if (done)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]