Commit e5e422bc authored by Michael Niedermayer's avatar Michael Niedermayer

mxfdec: Fix integer overflow with many channels

Fixes division by zero

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8d06be6b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment