Permalink
Browse files

Avoid arithmetic overflow warning(C6297) found by Visual studio

static analysis.
  • Loading branch information...
1 parent 6523adb commit a164ef53f2c38f331d2b4df8d7ff98693c4584a1 @ggcueroad ggcueroad committed Dec 3, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 libarchive/archive_ppmd7.c
@@ -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)

0 comments on commit a164ef5

Please sign in to comment.