summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-13 09:12:26 +0100
committerAndras Timar <andras.timar@collabora.com>2014-08-21 21:24:39 +0200
commitcc28a7cb04f91f5270aa888ee4d75a69791ce2c7 (patch)
tree77f62cddc38606402dd5e399432018ea394473ce /vcl
parentb318c70bc88a467cc72dba0079f1d872cf9e240f (diff)
valgrind + bff: don't add 0xffff oldcode
Invalid read of size 1 at 0x9DC6247: GIFLZWDecompressor::AddToTable(unsigned short, unsigned short) (decode.cxx:117) Change-Id: I9cea8dcd4a5eeaa1e793b9be96f82854b9d088af Reviewed-on: https://gerrit.libreoffice.org/10906 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qa/cppunit/graphicfilter/data/gif/pass/sf_3e0068c9b19bb548826bed0599f65745-15940-minimized.gifbin0 -> 47778 bytes
-rw-r--r--vcl/source/filter/igif/decode.cxx11
2 files changed, 7 insertions, 4 deletions
diff --git a/vcl/qa/cppunit/graphicfilter/data/gif/pass/sf_3e0068c9b19bb548826bed0599f65745-15940-minimized.gif b/vcl/qa/cppunit/graphicfilter/data/gif/pass/sf_3e0068c9b19bb548826bed0599f65745-15940-minimized.gif
new file mode 100644
index 000000000000..47f5d4341ba6
--- /dev/null
+++ b/vcl/qa/cppunit/graphicfilter/data/gif/pass/sf_3e0068c9b19bb548826bed0599f65745-15940-minimized.gif
Binary files differ
diff --git a/vcl/source/filter/igif/decode.cxx b/vcl/source/filter/igif/decode.cxx
index bf29328e5109..5900b4cbe7a6 100644
--- a/vcl/source/filter/igif/decode.cxx
+++ b/vcl/source/filter/igif/decode.cxx
@@ -166,10 +166,13 @@ bool GIFLZWDecompressor::ProcessOneCode()
}
else if ( ( nCode > nEOICode ) && ( nCode <= nTableSize ) )
{
- if ( nCode == nTableSize )
- AddToTable( nOldCode, nOldCode );
- else
- AddToTable( nOldCode, nCode );
+ if ( nOldCode != 0xffff )
+ {
+ if ( nCode == nTableSize )
+ AddToTable( nOldCode, nOldCode );
+ else
+ AddToTable( nOldCode, nCode );
+ }
}
else
{