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@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-08 02:43:14 +01:00
parent 8d06be6b8c
commit e5e422bcc3
1 changed files with 1 additions and 1 deletions

View File

@ -2070,7 +2070,7 @@ static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *p
pkt->pts = track->sample_count; pkt->pts = track->sample_count;
if (codec->channels <= 0 || av_get_bits_per_sample(codec->codec_id) <= 0) if (codec->channels <= 0 || av_get_bits_per_sample(codec->codec_id) <= 0)
return AVERROR(EINVAL); 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; return 0;
} }