aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-08-18 02:20:54 +0200
committerJames Almer <jamrial@gmail.com>2013-08-26 17:53:19 -0300
commit167278f377d8d124c43e525341b78c62bc6b1ed4 (patch)
tree073a4ef3f71cc69e01018340cfba8990499c815a /libavformat
parentfc83cfda36d540e10f2d93c15768ed8a4d240342 (diff)
downloadffmpeg-167278f377d8d124c43e525341b78c62bc6b1ed4.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)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index fc584bce86..f3b90a9cb6 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1664,6 +1664,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 ||