summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-04 02:47:58 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 00:35:12 +0100
commit2b26f8c6bf764423f644653974f7289078c2ffc9 (patch)
tree9b33462bcd98c0310cafade95ceab4bb6d8e1668
parent6e3697b985520d3d0f6b2719446b9c2d1fb021ec (diff)
downloadffmpeg-2b26f8c6bf764423f644653974f7289078c2ffc9.tar.gz
evrcdec: fix sign error
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> (cherry picked from commit f18d2dff1194b34b79dc7641aafe54d1df349e40) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/evrcdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c
index aec652ac8c..22f4688064 100644
--- a/libavcodec/evrcdec.c
+++ b/libavcodec/evrcdec.c
@@ -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) {