You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/nvdec_hevc: Fix off-by-one error
Fixes Coverity issues #1442912, #1442913, #1442916 and #1442917. Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -204,8 +204,8 @@ static int nvdec_hevc_start_frame(AVCodecContext *avctx,
|
|||||||
ppc->row_height_minus1[i] = pps->row_height[i] - 1;
|
ppc->row_height_minus1[i] = pps->row_height[i] - 1;
|
||||||
|
|
||||||
#if NVDECAPI_CHECK_VERSION(9, 0)
|
#if NVDECAPI_CHECK_VERSION(9, 0)
|
||||||
if (pps->chroma_qp_offset_list_len_minus1 > FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) ||
|
if (pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cb_qp_offset_list) ||
|
||||||
pps->chroma_qp_offset_list_len_minus1 > FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) {
|
pps->chroma_qp_offset_list_len_minus1 >= FF_ARRAY_ELEMS(ppc->cr_qp_offset_list)) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Too many chroma_qp_offsets\n");
|
av_log(avctx, AV_LOG_ERROR, "Too many chroma_qp_offsets\n");
|
||||||
return AVERROR(ENOSYS);
|
return AVERROR(ENOSYS);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user