[SCM] libav/experimental: Correct wrong lower limit and condition used in APE decoder

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:30:27 UTC 2013


The following commit has been merged in the experimental branch:
commit e774c41cab765f5d12ecfb31e5fa30df41230de0
Author: Kostya Shishkov <kostya.shishkov at gmail.com>
Date:   Wed Sep 24 12:45:28 2008 +0000

    Correct wrong lower limit and condition used in APE decoder
    
    Originally committed as revision 15396 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 0489ab4..82d567f 100644
--- 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++;

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list