Skip to content

Commit

Permalink
Fix a potential over run issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pengche1 authored and xhaihao committed Mar 14, 2018
1 parent dc95e3b commit 65ee298
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gen9_hevc_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -6570,7 +6570,11 @@ gen9_hevc_set_reflist(VADriverContextP ctx,

for (i = 0; i < 16; i++) {
frame_idx = -1;
obj_surface = SURFACE(ref_list[i].picture_id);
if (i < 15)
obj_surface = SURFACE(ref_list[i].picture_id);
else
obj_surface = NULL;

if (i < MIN((num_ref_minus1 + 1), GEN9_MAX_REF_SURFACES) && obj_surface) {
for (j = 0; j < GEN9_MAX_REF_SURFACES; j++) {
if (obj_surface == priv_ctx->reference_surfaces[j].obj_surface) {
Expand Down

0 comments on commit 65ee298

Please sign in to comment.