summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-28 16:43:44 +0000
committerAndras Timar <andras.timar@collabora.com>2017-03-06 16:08:01 +0100
commit379bbd2c19d1d937d23a93b125f55b25c4800069 (patch)
tree4c80bcc29fb7fe24410000fb29b44e21f5c129aa /filter
parent1d76f7103052ccd3ac29f7359272ebcad64ddc49 (diff)
ofz#668: check nTargetBits size
Change-Id: I5cc7499cfdee58ffa480bb31dfc262d5b781180d (cherry picked from commit 99c361be16eb3a21aa679a103db2d07ecd0f5d3c) Reviewed-on: https://gerrit.libreoffice.org/34723 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 138737f26407acfd6cf431e4a8745569fb786dec)
Diffstat (limited to 'filter')
-rw-r--r--filter/source/graphicfilter/itiff/ccidecom.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx
index 1cb7d7d53448..4fcb6b9a32ab 100644
--- a/filter/source/graphicfilter/itiff/ccidecom.cxx
+++ b/filter/source/graphicfilter/itiff/ccidecom.cxx
@@ -627,7 +627,9 @@ void CCIDecompressor::StartDecompression( SvStream & rIStream )
bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTargetBits, bool bLastLine )
{
- bool b2D;
+ //Read[1|2]DScanlineData take a sal_uInt16, so its either limit here or expand there
+ if (nTargetBits > SAL_MAX_UINT16)
+ return false;
if ( nEOLCount >= 5 ) // RTC (Return To Controller)
return true;
@@ -682,6 +684,7 @@ bool CCIDecompressor::DecompressScanline( sal_uInt8 * pTarget, sal_uLong nTarget
if ( nOptions & CCI_OPTION_BYTEALIGNROW )
nInputBitsBufSize &= 0xfff8;
+ bool b2D;
// is it a 2D row?
if ( nOptions & CCI_OPTION_2D )
{