aacps: avoid division by zero in stereo_processing
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Sun, 8 Nov 2015 21:04:08 +0000 (22:04 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Tue, 10 Nov 2015 01:33:24 +0000 (01:33 +0000)
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>
libavcodec/aacps.c

index 1165d9b..ccc79ff 100644 (file)
@@ -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