[FFmpeg-cvslog] avformat/matroskadec: check out_samplerate before using it in av_rescale()

Michael Niedermayer git at videolan.org
Mon Aug 26 23:58:49 CEST 2013


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 18 02:20:54 2013 +0200| [97f739ac9ba59793f77fb4248c8d36694e6ea75a] | committer: James Almer

avformat/matroskadec: check out_samplerate before using it in av_rescale()

Prevent assertion failure with damaged input

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 338f8b2eaf36f078eb5cc26ac10e651dc4c48243)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=97f739ac9ba59793f77fb4248c8d36694e6ea75a
---

 libavformat/matroskadec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 6e0e880..01b13a0 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1614,6 +1614,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 == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 ||



More information about the ffmpeg-cvslog mailing list