Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 65ee298

Browse files
pengche1xhaihao
authored andcommitted
Fix a potential over run issue
1 parent dc95e3b commit 65ee298

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/gen9_hevc_encoder.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -6570,7 +6570,11 @@ gen9_hevc_set_reflist(VADriverContextP ctx,
65706570

65716571
for (i = 0; i < 16; i++) {
65726572
frame_idx = -1;
6573-
obj_surface = SURFACE(ref_list[i].picture_id);
6573+
if (i < 15)
6574+
obj_surface = SURFACE(ref_list[i].picture_id);
6575+
else
6576+
obj_surface = NULL;
6577+
65746578
if (i < MIN((num_ref_minus1 + 1), GEN9_MAX_REF_SURFACES) && obj_surface) {
65756579
for (j = 0; j < GEN9_MAX_REF_SURFACES; j++) {
65766580
if (obj_surface == priv_ctx->reference_surfaces[j].obj_surface) {

0 commit comments

Comments
 (0)