[FFmpeg-cvslog] nutdec: check for negative frame rate in decode_info_header

Andreas Cadhalpun git at videolan.org
Tue Jun 2 00:50:17 CEST 2015


ffmpeg | branch: release/2.4 | Andreas Cadhalpun <andreas.cadhalpun at googlemail.com> | Tue Apr 28 20:31:56 2015 +0200| [e0ef1b8c0b21122850458d1c2c229d8bd852a74d] | committer: Michael Niedermayer

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 at googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 6621105877ce0d65724a8ab60b3a50160adbe65d)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e0ef1b8c0b21122850458d1c2c229d8bd852a74d
---

 libavformat/nutdec.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 6fff2bb..def8984 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;
             }



More information about the ffmpeg-cvslog mailing list