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

assume max compression of 255 for ras

Change-Id: I51dfa45b266b6b9361f48aac58f0a4bca8446bdd
üst 445a3d0a
......@@ -168,12 +168,17 @@ bool RASReader::ReadRAS(Graphic & rGraphic)
if (!bOk)
return false;
if (mnType != RAS_TYPE_BYTE_ENCODED) //simple raw format
//The RLE packets are typically three bytes in size:
//The first byte is a Flag Value indicating the type of RLE packet.
//The second byte is the Run Count.
//The third byte is the Run Value.
//
//for the sake of simplicity we'll assume that RAS_TYPE_BYTE_ENCODED can
//describe data 255 times larger than the data stored
size_t nMaxCompression = mnType != RAS_TYPE_BYTE_ENCODED ? 1 : 255;
if (m_rRAS.remainingSize() * nMaxCompression < static_cast<sal_uInt64>(mnHeight) * mnWidth * mnDepth / 8)
{
if (m_rRAS.remainingSize() < static_cast<sal_uInt64>(mnHeight) * mnWidth * mnDepth / 8)
{
return false;
}
return false;
}
Bitmap aBmp(Size(mnWidth, mnHeight), mnDstBitsPerPix);
......
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