[FFmpeg-cvslog] nuv: sanitize negative fps rate

Andreas Cadhalpun git at videolan.org
Sun Dec 20 15:24:16 CET 2015


ffmpeg | branch: release/2.6 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Dec 16 20:52:39 2015 +0100| [b2cb7db14f82737f0d25602336c7f0ba9bbffdab] | committer: Andreas Cadhalpun

nuv: sanitize negative fps rate

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
(cherry picked from commit f6830cf5ba03fdcfcd81a0358eb32d4081a2fcce)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

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

 libavformat/nuv.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 001d9c8..cb51511 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -172,6 +172,15 @@ static int nuv_header(AVFormatContext *s)
     if (aspect > 0.9999 && aspect < 1.0001)
         aspect = 4.0 / 3.0;
     fps = av_int2double(avio_rl64(pb));
+    if (fps < 0.0f) {
+        if (s->error_recognition & AV_EF_EXPLODE) {
+            av_log(s, AV_LOG_ERROR, "Invalid frame rate %f\n", fps);
+            return AVERROR_INVALIDDATA;
+        } else {
+            av_log(s, AV_LOG_WARNING, "Invalid frame rate %f, setting to 0.\n", fps);
+            fps = 0.0f;
+        }
+    }
 
     // number of packets per stream type, -1 means unknown, e.g. streaming
     v_packs = avio_rl32(pb);



More information about the ffmpeg-cvslog mailing list