From 99b1b2b1c65969ee324d754ea47e04a0a3f685a8 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 29 Jan 2013 17:13:45 +0100 Subject: r3d: check that sampling rate is non negative. Signed-off-by: Michael Niedermayer --- libavformat/r3d.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavformat/r3d.c') diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 5ee0b93686..3b3ecce3d9 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -285,6 +285,10 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom) dts = avio_rb32(s->pb); st->codec->sample_rate = avio_rb32(s->pb); + if (st->codec->sample_rate < 0) { + av_log(s, AV_LOG_ERROR, "negative sample rate\n"); + return AVERROR_INVALIDDATA; + } samples = avio_rb32(s->pb); -- cgit v1.2.3