vcl/source/gdi/dibtools.cxx |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 4aedf0956fb6849781bfb5139b04d8ca0708acdc
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Mon Jan 3 22:12:01 2022 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed Jan 5 13:56:48 2022 +0100

    tdf#73523 do not seek backwards, the color mask info is not there
    
    Change-Id: I97f0fd4f184ea77beeab8b22fc98fdb78472d9bb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127928
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/vcl/qa/cppunit/graphicfilter/data/bmp/fail/crash-1.bmp 
b/vcl/qa/cppunit/graphicfilter/data/bmp/pass/crash-1.bmp
similarity index 100%
rename from vcl/qa/cppunit/graphicfilter/data/bmp/fail/crash-1.bmp
rename to vcl/qa/cppunit/graphicfilter/data/bmp/pass/crash-1.bmp
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index ce1df4a68a65..949423a1f255 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -533,10 +533,9 @@ bool ImplReadDIBBits(SvStream& rIStm, DIBV5Header& 
rHeader, BitmapWriteAccess& r
     }
     else
     {
-        // Read color mask
-        if(bTCMask && BITFIELDS == rHeader.nCompression)
+        // Read color mask. An additional 12 bytes of color bitfields follow 
the info header (WinBMPv3-NT)
+        if(bTCMask && BITFIELDS == rHeader.nCompression && DIBINFOHEADERSIZE 
== rHeader.nSize)
         {
-            rIStm.SeekRel( -12 );
             rIStm.ReadUInt32( nRMask );
             rIStm.ReadUInt32( nGMask );
             rIStm.ReadUInt32( nBMask );

Reply via email to