diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index 87270cffb4..9bedee5f03 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -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); diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c index 3c4a9b0818..13316eebf3 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -372,7 +372,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); }