Skip to content

Commit

Permalink
lzma: fix overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jan 29, 2025
1 parent f118926 commit 9cfaceb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crnlib/lzma/Ppmd7Enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void Ppmd7z_RangeEnc_ShiftLow(CPpmd7 *p)

Z7_FORCE_INLINE
// Z7_NO_INLINE
static void Ppmd7z_RangeEnc_Encode(CPpmd7 *p, UInt32 start, UInt32 size)
static void Ppmd7z_RangeEnc_Encode(CPpmd7 *p, UInt64 start, UInt32 size)
{
R->Low += start * R->Range;
R->Range *= size;
Expand Down Expand Up @@ -93,7 +93,7 @@ void Ppmd7z_EncodeSymbol(CPpmd7 *p, int symbol)
if (p->MinContext->NumStats != 1)
{
CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
UInt32 sum;
UInt64 sum;
unsigned i;


Expand Down Expand Up @@ -251,7 +251,7 @@ void Ppmd7z_EncodeSymbol(CPpmd7 *p, int symbol)
const unsigned cur = s->Symbol;
if ((int)cur == symbol)
{
const UInt32 low = sum;
const UInt64 low = sum;
const UInt32 freq = s->Freq;
unsigned num2;

Expand Down

0 comments on commit 9cfaceb

Please sign in to comment.