projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f26be47
)
Correct wrong lower limit and condition used in APE decoder
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 24 Sep 2008 12:45:28 +0000
(12:45 +0000)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 24 Sep 2008 12:45:28 +0000
(12:45 +0000)
Originally committed as revision 15396 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavcodec/apedec.c
patch
|
blob
|
history
diff --git
a/libavcodec/apedec.c
b/libavcodec/apedec.c
index
0489ab4
..
82d567f
100644
(file)
--- a/
libavcodec/apedec.c
+++ b/
libavcodec/apedec.c
@@
-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++;