summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-12 10:56:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-07-14 11:41:59 +0000
commit11fb5b5cce6ebb857bd6ede39815b37256db3e1f (patch)
tree209f7b6fefaba38bbba720103428499f405bb9c7
parent6029d711a7af1a68ffa8d0cb0a0bd8092984f659 (diff)
fix another gif import crash
Change-Id: I0ffa569e0c4240e11184df7dd56b95d87a12425d (cherry picked from commit ee35b72064d8d1333709b102b051360018f8044b) Reviewed-on: https://gerrit.libreoffice.org/17002 Reviewed-by: David Tardon <dtardon@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/gif/pass/crash-2.gifbin0 -> 257 bytes
-rw-r--r--vcl/source/filter/igif/decode.cxx3
2 files changed, 3 insertions, 0 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/gif/pass/crash-2.gif b/vcl/qa/cppunit/graphicfilter/data/gif/pass/crash-2.gif
new file mode 100644
index 000000000000..b7265f807d51
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/gif/pass/crash-2.gif
Binary files differ
diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx
index 1b18f5ee134a..2b445e9e1d5a 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -193,6 +193,9 @@ bool GIFLZWDecompressor::ProcessOneCode()
nOldCode = nCode;
+ if (nCode > 4096)
+ return false;
+
// write character(/-sequence) of code nCode in the output buffer:
pE = pTable + nCode;
do