Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-16 22:52:39 +0300
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-12-20 16:18:11 +0300
commit7ad058168665a74c8975a2bb1bd4286d37280218 (patch)
tree59d18e2188eb31f77ca646d53cdafb63fbb269e4
parent3219de21f4e9e9bcd09df9dbc5eab63492dd05a4 (diff)
nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit f6830cf5ba03fdcfcd81a0358eb32d4081a2fcce) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/nuv.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index 001d9c8860..cb51511943 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);