diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-22 10:55:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-22 11:33:58 +0100 |
commit | 911c4d8472303053c19b14457a533d8b2f0a2ea9 (patch) | |
tree | 645e3f7242b356a6f2df140d07900dcdb8697d9b /vcl/source/gdi/bitmap3.cxx | |
parent | 68cf256f506d4601a2d2cf3ec2d56713afd491e6 (diff) |
crashtesting: assert on export of tdf96006-1.odt to rtf
revealed since...
commit 81e3ca4f60e6ac0823c1233841c22a759cfe937f
Author: Tor Lillqvist <tml@collabora.com>
Date: Tue Jun 21 10:34:21 2016 +0300
surely here we should ask the palette how many entries are
in it, not assume from the original bitcount that all entries
exist.
presumably the palette can only have <= 1 << BitCount entries in it
Change-Id: Ieb1b98f2f13f702a6a6a20d8cf3d8e9a695141b2
Diffstat (limited to 'vcl/source/gdi/bitmap3.cxx')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index c5de58414969..98ede1450b47 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -623,8 +623,9 @@ bool Bitmap::ImplConvertUp(sal_uInt16 nBitCount, Color* pExtColor) if (pWriteAcc->HasPalette()) { - const sal_uInt16 nOldCount = 1 << GetBitCount(); const BitmapPalette& rOldPalette = pReadAcc->GetPalette(); + const sal_uInt16 nOldCount = rOldPalette.GetEntryCount(); + assert(nOldCount <= (1 << GetBitCount())); aPalette.SetEntryCount(1 << nBitCount); |