diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-12-16 20:52:39 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-01-13 09:37:11 +0100 |
commit | 5b83b24ccbec79359f2dcdc0f49e09010a05e58a (patch) | |
tree | 8a298af051cc73e9174f5f41989b454ffaaa1cb9 /libavformat | |
parent | 2884cf205a9a29d89db7a444c5b1613cdfe37acf (diff) | |
download | ffmpeg-5b83b24ccbec79359f2dcdc0f49e09010a05e58a.tar.gz |
nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nuv.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index aeb2fae466..f553dd1e25 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -175,6 +175,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); |