diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-10-24 12:36:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-10-25 09:57:46 +0200 |
commit | b6deca4b06764409c283f4599d71baef5b2df7f6 (patch) | |
tree | 593007ac5ea633d1697d5e5c60f7d5c4a3b71230 | |
parent | d5a37cd8af4e9025a773980aa1436f78ec1941f7 (diff) |
ofz#3761 Undefined-shift
Change-Id: Ibf45da2dd5aa351973b7227371e4f6c35d54021d
Reviewed-on: https://gerrit.libreoffice.org/43764
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | filter/source/graphicfilter/ios2met/ios2met.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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) |