From d59f9c6f73b65a03ca1819eca264eb7d58f06b67 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Feb 2014 18:03:39 +0530 Subject: [PATCH] Fix #1276127 [calibre/src/unrar/unpack.cpp:1159]: (style) Array index 'CurBitLength' is used before limits check.](https://bugs.launchpad.net/calibre/+bug/1276127) --- src/unrar/unpack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unrar/unpack.cpp b/src/unrar/unpack.cpp index 350d8951f0..178fa714e5 100644 --- a/src/unrar/unpack.cpp +++ b/src/unrar/unpack.cpp @@ -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 // accordingly if necessary. - while (BitField>=Dec->DecodeLen[CurBitLength] && CurBitLengthDecodeLen)) + while (CurBitLengthDecodeLen) && BitField>=Dec->DecodeLen[CurBitLength] ) CurBitLength++; // Translation of right aligned bit string to bit length.