diff options
author | Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> | 2015-04-28 20:31:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-17 21:50:09 +0200 |
commit | b548a6208eed898599bca0bf7979ba1d03932183 (patch) | |
tree | 8919b638bfa550604c64d50ce5b9cfad4a07befb | |
parent | 02b434044caa93e0384844dcff597d29ae31efe2 (diff) | |
download | ffmpeg-b548a6208eed898599bca0bf7979ba1d03932183.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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index a63de7d437..dbf8df3b06 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -560,7 +560,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; } |