mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-09-19 21:06:42 +00:00
lavc/hevc: check framerate num/den to be strictly positive
Rather than just != 0. These values are read as uint32 and can become negative when cast to int. (cherry picked from commiteec1a7a6bb
) Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit9cadadb9a1
) Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
parent
6387156008
commit
c22db2bcf2
@ -105,7 +105,7 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal,
|
||||
den = ps->sps->vui.vui_time_scale;
|
||||
}
|
||||
|
||||
if (num != 0 && den != 0)
|
||||
if (num > 0 && den > 0)
|
||||
av_reduce(&avctx->framerate.den, &avctx->framerate.num,
|
||||
num, den, 1 << 30);
|
||||
|
||||
|
@ -374,7 +374,7 @@ static void export_stream_params(HEVCContext *s, const HEVCSPS *sps)
|
||||
den = sps->vui.vui_time_scale;
|
||||
}
|
||||
|
||||
if (num != 0 && den != 0)
|
||||
if (num > 0 && den > 0)
|
||||
av_reduce(&avctx->framerate.den, &avctx->framerate.num,
|
||||
num, den, 1 << 30);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user