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

coverity#1202754 Bad bit shift operation

Change-Id: I51e8df896897b122965ada0ced161570d38f0468
üst 17796bfb
...@@ -356,14 +356,14 @@ bool PSDReader::ImplReadBody() ...@@ -356,14 +356,14 @@ bool PSDReader::ImplReadBody()
} }
if ( nRunCount & 0x80 ) // a run length packet if ( nRunCount & 0x80 ) // a run length packet
{ {
if ( nBitCount == -1 ) // bits left in nDat?
{
m_rPSD.ReadUChar( nDat );
nDat ^= 0xff;
nBitCount = 7;
}
for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ ) for ( sal_uInt16 i = 0; i < ( -nRunCount + 1 ); i++ )
{ {
if ( nBitCount == -1 ) // bits left in nDat?
{
m_rPSD.ReadUChar( nDat );
nDat ^= 0xff;
nBitCount = 7;
}
mpWriteAcc->SetPixelIndex( nY, nX, nDat >> nBitCount-- ); mpWriteAcc->SetPixelIndex( nY, nX, nDat >> nBitCount-- );
if ( ++nX == mpFileHeader->nColumns ) if ( ++nX == mpFileHeader->nColumns )
{ {
......
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