Skip to content
Snippets Groups Projects
Commit 5b83b24c authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Anton Khirnov
Browse files

nuv: sanitize negative fps rate

parent 2884cf20
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment