avcodec/sbrdsp_template: Fix: runtime error: signed integer overflow: 849815297 ...
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 23 May 2017 19:08:48 +0000 (21:08 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 5 Jun 2017 21:16:54 +0000 (23:16 +0200)
Fixes: 1770/clusterfuzz-testcase-minimized-5285511235108864

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c36ee216f1e668e2c2af1573bd9dbbb2a501f48)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/sbrdsp_template.c

index b649dfd..897a3bb 100644 (file)
@@ -33,8 +33,13 @@ static void sbr_qmf_deint_bfly_c(INTFLOAT *v, const INTFLOAT *src0, const INTFLO
 {
     int i;
     for (i = 0; i < 64; i++) {
-        v[      i] = AAC_SRA_R((src0[i] - src1[63 - i]), 5);
-        v[127 - i] = AAC_SRA_R((src0[i] + src1[63 - i]), 5);
+#if USE_FIXED
+        v[      i] = (int)(0x10U + src0[i] - src1[63 - i]) >> 5;
+        v[127 - i] = (int)(0x10U + src0[i] + src1[63 - i]) >> 5;
+#else
+        v[      i] = src0[i] - src1[63 - i];
+        v[127 - i] = src0[i] + src1[63 - i];
+#endif
     }
 }