Kaydet (Commit) b08e4816 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: ofz#310: Sanitize 1 bit bitmap palette indexes too

Change-Id: Ied2b71eb1c9088bbbff5fed97f7a04b43f4b4827
üst 2ac9ea00
......@@ -565,6 +565,9 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
{
case 1:
{
const bool bHasPalette = rAcc.HasPalette();
const sal_uInt16 nPaletteEntryCount = rAcc.GetPaletteEntryCount();
for( ; nCount--; nY += nI )
{
sal_uInt8 * pTmp = pBuf.get();
......@@ -583,7 +586,8 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& rHeader, BitmapWriteAccess& r
cTmp = *pTmp++;
}
rAcc.SetPixelIndex( nY, nX, (cTmp >> --nShift) & 1);
auto nIndex = (cTmp >> --nShift) & 1;
rAcc.SetPixelIndex(nY, nX, SanitizePaletteIndex(nIndex, bHasPalette, nPaletteEntryCount));
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment