mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f6830cf5ba
)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
174ec7d744
commit
79f407b79a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user