diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-03 03:14:11 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-12-14 16:51:00 +0100 |
commit | da87a699ea9c1ba0b330413528dbca29bcc54ef8 (patch) | |
tree | 8f13355e5c1c7fd5c0977eafc9c0615c9a204bc8 | |
parent | 86a52988bd50b16d7f4c52e610de00d5354c5174 (diff) | |
download | ffmpeg-da87a699ea9c1ba0b330413528dbca29bcc54ef8.tar.gz |
avutil/timecode: Fix fps check
The fps variable is explicitly set to -1 in case of some errors, the check must
thus be signed or the code setting it needs to use 0 as error code
the type of the field could be changed as well but its in an installed header
Fixes: integer overflow
Fixes: 9982cc157b1ea90429435640a989122f/asan_generic_3ad004a_3799_22cf198d9cd09928e2d9ad250474fa58.mov
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b46dcd5209a77254345ae098b83a872634c5591b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavutil/timecode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/timecode.c b/libavutil/timecode.c index 1dfd040868..bf463ed515 100644 --- a/libavutil/timecode.c +++ b/libavutil/timecode.c @@ -151,7 +151,7 @@ static int check_fps(int fps) static int check_timecode(void *log_ctx, AVTimecode *tc) { - if (tc->fps <= 0) { + if ((int)tc->fps <= 0) { av_log(log_ctx, AV_LOG_ERROR, "Timecode frame rate must be specified\n"); return AVERROR(EINVAL); } |