If 'buf_size * 8' is smaller than 'avctx->channels *
(avctx->bits_per_raw_sample + 4)' it resulted in a division by zero.

Signed-off-by: Andreas Cadhalpun <andreas.cadhal...@googlemail.com>
---
 libavcodec/s302m.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/s302m.c b/libavcodec/s302m.c
index 5cf9eb5..36c8e7c 100644
--- a/libavcodec/s302m.c
+++ b/libavcodec/s302m.c
@@ -86,9 +86,9 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, 
const uint8_t *buf,
             avctx->channel_layout = AV_CH_LAYOUT_5POINT1_BACK | 
AV_CH_LAYOUT_STEREO_DOWNMIX;
     }
     avctx->bit_rate    = 48000 * avctx->channels * (avctx->bits_per_raw_sample 
+ 4) +
-                         32 * (48000 / (buf_size * 8 /
-                                        (avctx->channels *
-                                         (avctx->bits_per_raw_sample + 4))));
+                         32 * (48000 * avctx->channels
+                                * (avctx->bits_per_raw_sample + 4))
+                            / (buf_size * 8);
 
     return frame_size;
 }
-- 
2.1.4
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to