X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fnuv.c;h=c30da607113c67fbb97e5ef053449e1e6e46cb5d;hb=eb50a3d4409d23429e7576429647d43dce09e69d;hp=2a1b70f09ad595f6c4e241b69d7e94da75d87be5;hpb=14a28298cb8815de1138181ac7f8992f927cb12a;p=ffmpeg diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 2a1b70f09ad..c30da607113 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);