diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-01-30 21:33:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-01-30 22:44:46 +0000 |
commit | 267d6e19e393f9352ee743d213e8d82f74141877 (patch) | |
tree | 3c36f8032a270b88bab2396e9919545fc7133c02 | |
parent | 8d999b118e553a47a34639c7fda138b609b7aac9 (diff) |
ofz: we're going to need at last a len field and a CounterByte on each row
Change-Id: I5c5c2d67bcba7692e696be6ab96db041b20416a4
-rw-r--r-- | filter/source/graphicfilter/ipict/ipict.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx index 58d8c794ecf9..2fa6228d40f5 100644 --- a/filter/source/graphicfilter/ipict/ipict.cxx +++ b/filter/source/graphicfilter/ipict/ipict.cxx @@ -938,14 +938,10 @@ sal_uLong PictReader::ReadPixMapEtc( Bitmap &rBitmap, bool bBaseAddr, bool bColo if (nHeight > pPict->remainingSize() / (sizeof(sal_uInt16) * nWidth)) return 0xffffffff; } - else if (nRowBytes > 250) - { - if (nHeight > pPict->remainingSize() / sizeof(sal_uInt16)) - return 0xffffffff; - } else { - if (nHeight > pPict->remainingSize() / sizeof(sal_uInt8)) + size_t nByteCountSize = nRowBytes > 250 ? sizeof(sal_uInt16) : sizeof(sal_uInt8); + if (nHeight > pPict->remainingSize() / ((nByteCountSize + sizeof(sal_uInt8)) * nWidth)) return 0xffffffff; } |