diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-01-05 10:56:32 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-01-08 15:09:27 +0100 |
commit | 10e0f274aad7b9236b38c9354c004a8b14e29702 (patch) | |
tree | 3aac3a9f40bf6d51cf5081869fc47ca6a0667e41 /filter | |
parent | e60345a9e8caf3aa618a10da24264f7bdac34b6b (diff) |
asan wrt mandriva57054-1.tiff
Change-Id: Ibb7ecfa637ff96fbda3a8ed5d67943ece28927e5
(cherry picked from commit f901624b5e13e300f8e2facd2a824202c21d9729)
Reviewed-on: https://gerrit.libreoffice.org/13739
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit f28a5e89eb668b702e90beb58276cef5d74a6d18)
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/graphicfilter/itiff/itiff.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index 4122ab28385e..1d532ccd2cab 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -926,23 +926,22 @@ bool TIFFReader::ConvertScanline( sal_uLong nY ) { case 8 : { - sal_uInt8 nLast; if ( bByteSwap ) { if ( nPredictor == 2 ) { - nLast = BYTESWAP( (sal_uInt8)*pt++ ); + sal_uInt8 nLast = 0; for ( nx = 0; nx < nImageWidth; nx++ ) { + nLast += nx == 0 ? BYTESWAP( (sal_uInt8)*pt++ ) : *pt++; pAcc->SetPixelIndex( nY, nx, nLast ); - nLast = nLast + *pt++; } } else { for ( nx = 0; nx < nImageWidth; nx++ ) { - nLast = *pt++; + sal_uInt8 nLast = *pt++; pAcc->SetPixelIndex( nY, nx, static_cast<sal_uInt8>( (BYTESWAP((sal_uLong)nLast) - nMinSampleValue) * nMinMax ) ); } } @@ -951,11 +950,11 @@ bool TIFFReader::ConvertScanline( sal_uLong nY ) { if ( nPredictor == 2 ) { - nLast = *pt++; + sal_uInt8 nLast = 0; for ( nx = 0; nx < nImageWidth; nx++ ) { + nLast += *pt++; pAcc->SetPixelIndex( nY, nx, nLast ); - nLast = nLast + *pt++; } } else |