]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Avoid arithmetic overflow warning(C6297) found by Visual studio
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 3 Dec 2012 03:51:29 +0000 (12:51 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Mon, 3 Dec 2012 03:51:29 +0000 (12:51 +0900)
static analysis.

libarchive/archive_ppmd7.c

index 13a258188a61b4234d8bb7e80034c11d0bd95154..fe0b0318cc05078d1beb30d16442856f1ade8e02 100644 (file)
@@ -990,7 +990,7 @@ static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)
     p->Cache = (Byte)((UInt32)p->Low >> 24);
   }
   p->CacheSize++;
-  p->Low = (UInt32)p->Low << 8;
+  p->Low = ((UInt32)p->Low << 8) & 0xFFFFFFFF;
 }
 
 static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)