Commit 5ccf296e authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/h264_direct: Fix overflow in POC comparission

Fixes: runtime error: signed integer overflow: 2147421862 - -33624063 cannot be represented in type 'int'
Fixes: 12885/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5733516975800320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6bfda984
......@@ -156,8 +156,8 @@ void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *
av_log(h->avctx, AV_LOG_ERROR, "co located POCs unavailable\n");
sl->col_parity = 1;
} else
sl->col_parity = (FFABS(col_poc[0] - cur_poc) >=
FFABS(col_poc[1] - cur_poc));
sl->col_parity = (FFABS(col_poc[0] - (int64_t)cur_poc) >=
FFABS(col_poc[1] - (int64_t)cur_poc));
ref1sidx =
sidx = sl->col_parity;
// FL -> FL & differ parity
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment