filter/source/graphicfilter/itiff/itiff.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 73301934b4a1861d751724e8153fbb4fb26912b9 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 28 10:07:50 2017 +0100 ofz#2766 ensure palette is large enough for all colors Change-Id: I4669b473f5975ac74a37025f7c936f13bcfea420 Reviewed-on: https://gerrit.libreoffice.org/40512 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx index af1707379a44..20e4ce45fcd4 100644 --- a/filter/source/graphicfilter/itiff/itiff.cxx +++ b/filter/source/graphicfilter/itiff/itiff.cxx @@ -1128,7 +1128,6 @@ void TIFFReader::MakePalCol() nNumColors = nLargestPixelIndex + 1; } - pAcc->SetPaletteEntryCount(nNumColors); for (sal_uInt32 i = 0; i < nNumColors; ++i) { sal_uInt32 nVal = ( i * 255 / ( nNumColors - 1 ) ) & 0xff; @@ -1139,6 +1138,7 @@ void TIFFReader::MakePalCol() xColorMap[nNumColors - i - 1] = n0RGB; } } + pAcc->SetPaletteEntryCount(std::max<sal_uInt16>(nNumColors, pAcc->GetPaletteEntryCount())); for (sal_uInt32 i = 0; i < nNumColors; ++i) { pAcc->SetPaletteColor(i, BitmapColor( (sal_uInt8)( xColorMap[ i ] >> 16 ),
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits