From f18d2dff1194b34b79dc7641aafe54d1df349e40 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 4 May 2013 02:47:58 +0200 Subject: [PATCH] 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 --- libavcodec/evrcdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/evrcdec.c b/libavcodec/evrcdec.c index f0e594fdde..f104e3313b 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) {