evrcdec: fix sign error
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 4 May 2013 00:47:58 +0000 (02:47 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 4 May 2013 00:50:30 +0000 (02:50 +0200)
The specification wants round(abs(x))) * sign(x) which is
equivakent to round(x)

Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/evrcdec.c

index f0e594f..f104e33 100644 (file)
@@ -374,7 +374,7 @@ static void bl_intrp(EVRCContext *e, float *ex, float delay)
     int offset, i, coef_idx;
     int16_t t;
 
-    offset = lrintf(fabs(delay));
+    offset = lrintf(delay);
 
     t = (offset - delay + 0.5) * 8.0 + 0.5;
     if (t == 8) {