diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-18 02:20:54 +0200 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2013-08-26 17:52:49 -0300 |
commit | 40b8e7f168e36b91f8119c1482122140de2a5813 (patch) | |
tree | 09f90c92995ead1cd1ad907c89c8de82cbc8919a | |
parent | 77783c7114ab2720f065aa2474b252121a5a1d11 (diff) | |
download | ffmpeg-40b8e7f168e36b91f8119c1482122140de2a5813.tar.gz |
avformat/matroskadec: check out_samplerate before using it in av_rescale()
Prevent assertion failure with damaged input
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 338f8b2eaf36f078eb5cc26ac10e651dc4c48243)
-rw-r--r-- | libavformat/matroskadec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index de9b58f719..350df45329 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1672,6 +1672,8 @@ static int matroska_read_header(AVFormatContext *s) avio_wl16(&b, 1); avio_wl16(&b, track->audio.channels); avio_wl16(&b, track->audio.bitdepth); + if (track->audio.out_samplerate < 0 || track->audio.out_samplerate > INT_MAX) + return AVERROR_INVALIDDATA; avio_wl32(&b, track->audio.out_samplerate); avio_wl32(&b, av_rescale((matroska->duration * matroska->time_scale), track->audio.out_samplerate, AV_TIME_BASE * 1000)); } else if (codec_id == AV_CODEC_ID_RV10 || codec_id == AV_CODEC_ID_RV20 || |