diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 15:12:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 15:14:31 +0200 |
commit | f657ca0d0b3be7b5b9015d86af241b9237709652 (patch) | |
tree | d8e21ec842f895ee3842dd41c61c78d01a09afb0 /libavformat/r3d.c | |
parent | 2a930fa29ea2ae4d613159d3697a4c4d3c47679f (diff) | |
parent | d8798276b65543d921adadf63cc7f5ba2d1604af (diff) | |
download | ffmpeg-f657ca0d0b3be7b5b9015d86af241b9237709652.tar.gz |
Merge commit 'd8798276b65543d921adadf63cc7f5ba2d1604af'
* commit 'd8798276b65543d921adadf63cc7f5ba2d1604af':
r3d: Add more input value validation
Conflicts:
libavformat/r3d.c
See: 99b1b2b1c65969ee324d754ea47e04a0a3f685a8
See: df92ac18528bac4566fc4f5ba4d607c1265791ea
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/r3d.c')
-rw-r--r-- | libavformat/r3d.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 8459cddc70..0719fb601a 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -85,7 +85,7 @@ static int r3d_read_red1(AVFormatContext *s) framerate.num = avio_rb16(s->pb); framerate.den = avio_rb16(s->pb); - if (framerate.num && framerate.den) { + if (framerate.num > 0 && framerate.den > 0) { #if FF_API_R_FRAME_RATE st->r_frame_rate = #endif @@ -283,8 +283,8 @@ 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"); + if (st->codec->sample_rate <= 0) { + av_log(s, AV_LOG_ERROR, "Bad sample rate\n"); return AVERROR_INVALIDDATA; } |