Fix #1276127 [calibre/src/unrar/unpack.cpp:1159]: (style) Array index 'CurBitLength' is used before limits check.](https://bugs.launchpad.net/calibre/+bug/1276127)

This commit is contained in:
Kovid Goyal 2014-02-04 18:03:39 +05:30
parent 2e608ed179
commit d59f9c6f73

View File

@ -1156,7 +1156,7 @@ void Unpack::MakeDecodeTables(byte *LengthTable,DecodeTable *Dec,uint Size)
// Find the upper limit for current bit field and adjust the bit length // Find the upper limit for current bit field and adjust the bit length
// accordingly if necessary. // accordingly if necessary.
while (BitField>=Dec->DecodeLen[CurBitLength] && CurBitLength<ASIZE(Dec->DecodeLen)) while (CurBitLength<ASIZE(Dec->DecodeLen) && BitField>=Dec->DecodeLen[CurBitLength] )
CurBitLength++; CurBitLength++;
// Translation of right aligned bit string to bit length. // Translation of right aligned bit string to bit length.