Commit 7a858172 authored by kostya's avatar kostya

Correct wrong lower limit and condition used in APE decoder

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15396 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a5ef3f8a
......@@ -358,11 +358,10 @@ static inline int range_get_symbol(APEContext * ctx,
static inline void update_rice(APERice *rice, int x)
{
int lim = rice->k ? (1 << (rice->k + 4)) : 0;
rice->ksum += ((x + 1) / 2) - ((rice->ksum + 16) >> 5);
if (rice->k == 0)
rice->k = 1;
else if (rice->ksum < (1 << (rice->k + 4)))
if (rice->ksum < lim)
rice->k--;
else if (rice->ksum >= (1 << (rice->k + 5)))
rice->k++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment