aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-11-08 22:04:08 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-26 01:35:45 +0100
commitc3f276b60830750a31e73c54edc2dd33e1f172bf (patch)
tree1559180968f7ef3ab4534d9eb6ef0324cfab6b00
parent510d88ae939f80a0e69188135d9ca7824a2c1075 (diff)
downloadffmpeg-c3f276b60830750a31e73c54edc2dd33e1f172bf.tar.gz
aacps: avoid division by zero in stereo_processing
This fixes a SIGFPE crash in the aac_fixed decoder. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> (cherry picked from commit ef7fe9851e0913a2e8d27d55bcb84847a6efa7ca) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavcodec/aacps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c
index 1165d9be3f..ccc79ffc1d 100644
--- a/libavcodec/aacps.c
+++ b/libavcodec/aacps.c
@@ -940,7 +940,7 @@ static void stereo_processing(PSContext *ps, INTFLOAT (*l)[32][2], INTFLOAT (*r)
LOCAL_ALIGNED_16(INTFLOAT, h_step, [2], [4]);
int start = ps->border_position[e];
int stop = ps->border_position[e+1];
- INTFLOAT width = Q30(1.f) / (stop - start);
+ INTFLOAT width = Q30(1.f) / ((stop - start) ? (stop - start) : 1);
#if USE_FIXED
width <<= 1;
#endif