[Libreoffice-commits] core.git: filter/source

Caolán McNamara caolanm at redhat.com
Wed Oct 25 07:58:08 UTC 2017


 filter/source/graphicfilter/ios2met/ios2met.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit b6deca4b06764409c283f4599d71baef5b2df7f6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Oct 24 12:36:54 2017 +0100

    ofz#3761 Undefined-shift
    
    Change-Id: Ibf45da2dd5aa351973b7227371e4f6c35d54021d
    Reviewed-on: https://gerrit.libreoffice.org/43764
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index ee0d2d7a885f..0c87aef23080 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -2474,11 +2474,13 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
             pB->pBMP=nullptr; pB->nWidth=0; pB->nHeight=0; pB->nBitsPerPixel=0;
             pB->nMapPos=0;
             // determine ID of the bitmap:
-            sal_uInt8 i,nbyte,nbyte2;
             pB->nID=0;
-            for (i=0; i<4; i++) {
-                pOS2MET->ReadUChar( nbyte ).ReadUChar( nbyte2 );
-                nbyte=((nbyte-0x30)<<4)|(nbyte2-0x30);
+            for (sal_uInt8 i = 0; i < 4; ++i) {
+                sal_uInt8 nbyte(0),nbyte2(0);
+                pOS2MET->ReadUChar(nbyte).ReadUChar(nbyte2);
+                nbyte -= 0x30;
+                nbyte2 -= 0x30;
+                nbyte = (nbyte << 4) | nbyte2;
                 pB->nID=(pB->nID>>8)|(((sal_uLong)nbyte)<<24);
             }
             // put new palette on the palette stack: (will be filled later)


More information about the Libreoffice-commits mailing list