aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-23 21:08:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-28 03:07:45 +0200
commit7c36ee216f1e668e2c2af1573bd9dbbb2a501f48 (patch)
tree2395b31a1c498928e3bb13b2ba86017ef0854074
parentfe8c9420dd5bbc7a0c545e479da9118bcf311dd2 (diff)
downloadffmpeg-7c36ee216f1e668e2c2af1573bd9dbbb2a501f48.tar.gz
avcodec/sbrdsp_template: Fix: runtime error: signed integer overflow: 849815297 + 1315389781 cannot be represented in type 'int'
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>
-rw-r--r--libavcodec/sbrdsp_template.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/sbrdsp_template.c b/libavcodec/sbrdsp_template.c
index b649dfd7ee..897a3bbffb 100644
--- a/libavcodec/sbrdsp_template.c
+++ b/libavcodec/sbrdsp_template.c
@@ -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
}
}