Skip to content

Commit

Permalink
possible fix for #435
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Nov 23, 2023
1 parent 7e4faf2 commit 1475c7d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libde265/motion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1864,7 +1864,14 @@ void derive_spatial_luma_vector_prediction(base_context* ctx,
logmvcand(vi);

const de265_image* imgX = NULL;
if (vi.predFlag[X]) imgX = ctx->get_image(shdr->RefPicList[X][ vi.refIdx[X] ]);
if (vi.predFlag[X]) {
if (vi.refIdx[X] < 0 || vi.refIdx[X] >= MAX_NUM_REF_PICS) {
return;
}

imgX = ctx->get_image(shdr->RefPicList[X][ vi.refIdx[X] ]);
}

const de265_image* imgY = NULL;
if (vi.predFlag[Y]) {
if (vi.refIdx[Y] < 0 || vi.refIdx[Y] >= MAX_NUM_REF_PICS) {
Expand Down

0 comments on commit 1475c7d

Please sign in to comment.