diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-12-12 14:35:31 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-12-12 14:35:47 +0400 |
commit | 75b3911e5a6d8f504723303444f534878e09a954 (patch) | |
tree | 23772da3f81d1627eb74f902fc44c795990fbfa4 /libavformat/mxfdec.c | |
parent | a0f659b27575de81549e524d13457554b9095ac8 (diff) |
mxf_set_audio_pts: fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r-- | libavformat/mxfdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 0d773c5b0c..e8ecbd9083 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2057,6 +2057,8 @@ static int mxf_set_audio_pts(MXFContext *mxf, AVCodecContext *codec, AVPacket *p { MXFTrack *track = mxf->fc->streams[pkt->stream_index]->priv_data; 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); return 0; } |