summaryrefslogtreecommitdiff
path: root/libavformat/r3d.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-29 17:13:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-29 17:13:45 +0100
commit99b1b2b1c65969ee324d754ea47e04a0a3f685a8 (patch)
treee848f3a672e2b0be94f5465ef00a597939d95bd8 /libavformat/r3d.c
parentdf92ac18528bac4566fc4f5ba4d607c1265791ea (diff)
downloadffmpeg-99b1b2b1c65969ee324d754ea47e04a0a3f685a8.tar.gz
r3d: check that sampling rate is non negative.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/r3d.c')
-rw-r--r--libavformat/r3d.c4
1 files changed, 4 insertions, 0 deletions
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);