[FFmpeg-cvslog] mxfdec: Fix integer overflow with many channels

Michael Niedermayer git at videolan.org
Fri Jan 11 18:33:51 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan  8 02:43:14 2013 +0100| [e5e422bcc3e6deee8c5c5bf8f5aeca2c051542f5] | committer: Michael Niedermayer

mxfdec: Fix integer overflow with many channels

Fixes division by zero

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Matthieu Bouron <matthieu.bouron at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5e422bcc3e6deee8c5c5bf8f5aeca2c051542f5
---

 libavformat/mxfdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index bb5f4a7..648a579 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2070,7 +2070,7 @@ static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *p
     pkt->pts = track->sample_count;
     if (codec->channels <= 0 || av_get_bits_per_sample(codec->codec_id) <= 0)
         return AVERROR(EINVAL);
-    track->sample_count += pkt->size / (codec->channels * av_get_bits_per_sample(codec->codec_id) / 8);
+    track->sample_count += pkt->size / (codec->channels * (int64_t)av_get_bits_per_sample(codec->codec_id) / 8);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list