diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-20 10:26:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-20 11:55:06 +0100 |
commit | c8b18c0311b2441f19f9b6b37846a83c0417edc6 (patch) | |
tree | 3b3b8cc5821a65b4f4957ea8483fd4d53e685dda | |
parent | a5f629fa8edb73e5d74350b3c2d102ae37128382 (diff) |
valgrind: Uninitialised value created by stack allocation
-rw-r--r-- | filter/source/graphicfilter/itiff/ccidecom.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/filter/source/graphicfilter/itiff/ccidecom.cxx b/filter/source/graphicfilter/itiff/ccidecom.cxx index 92aef911b5f9..e656f2f5f4ba 100644 --- a/filter/source/graphicfilter/itiff/ccidecom.cxx +++ b/filter/source/graphicfilter/itiff/ccidecom.cxx @@ -847,20 +847,19 @@ sal_uInt8 CCIDecompressor::ReadBlackOrWhite() sal_uInt16 CCIDecompressor::ReadCodeAndDecode(const CCILookUpTableEntry * pLookUp, sal_uInt16 nMaxCodeBits) { - sal_uInt16 nCode,nCodeBits; - sal_uInt8 nByte; - // Einen Huffman-Code einlesen und dekodieren: - while (nInputBitsBufSize<nMaxCodeBits) { + while (nInputBitsBufSize<nMaxCodeBits) + { + sal_uInt8 nByte(0); *pIStream >> nByte; if ( nOptions & CCI_OPTION_INVERSEBITORDER ) nByte = pByteSwap[ nByte ]; nInputBitsBuf=(nInputBitsBuf<<8) | (sal_uLong)nByte; nInputBitsBufSize+=8; } - nCode=(sal_uInt16)((nInputBitsBuf>>(nInputBitsBufSize-nMaxCodeBits)) + sal_uInt16 nCode = (sal_uInt16)((nInputBitsBuf>>(nInputBitsBufSize-nMaxCodeBits)) &(0xffff>>(16-nMaxCodeBits))); - nCodeBits=pLookUp[nCode].nCodeBits; + sal_uInt16 nCodeBits = pLookUp[nCode].nCodeBits; if (nCodeBits==0) bStatus=sal_False; nInputBitsBufSize = nInputBitsBufSize - nCodeBits; return pLookUp[nCode].nValue; |