aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-04-28 20:31:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-01 23:25:21 +0200
commite0ef1b8c0b21122850458d1c2c229d8bd852a74d (patch)
tree117d9282a5da36e9c805b9a6d2da4a49c18e5ad2
parent723d2b0c5b6b8e433fc1d8ed001e571107578079 (diff)
downloadffmpeg-e0ef1b8c0b21122850458d1c2c229d8bd852a74d.tar.gz
nutdec: check for negative frame rate in decode_info_header
A negative frame rate triggers an av_assert2 in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 6621105877ce0d65724a8ab60b3a50160adbe65d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/nutdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 6fff2bb132..def89849f5 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -575,7 +575,8 @@ static int decode_info_header(NUTContext *nut)
if (stream_id_plus1 && !strcmp(name, "r_frame_rate")) {
sscanf(str_value, "%d/%d", &st->r_frame_rate.num, &st->r_frame_rate.den);
- if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den)
+ if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den ||
+ st->r_frame_rate.num < 0 || st->r_frame_rate.num < 0)
st->r_frame_rate.num = st->r_frame_rate.den = 0;
continue;
}