diff --git a/.pick_status.json b/.pick_status.json index fe29ed7dd9d..852c9a807fc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1164,7 +1164,7 @@ "description": "frontends/va: Fix finding LTRs from POCs in HEVC decode", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "779edc07598399435d83874e7f0086be9d28317e", "notes": null diff --git a/src/gallium/frontends/va/picture_hevc.c b/src/gallium/frontends/va/picture_hevc.c index 16ba4ca4b79..aa2b6db6993 100644 --- a/src/gallium/frontends/va/picture_hevc.c +++ b/src/gallium/frontends/va/picture_hevc.c @@ -420,7 +420,9 @@ void vlVaDecoderHEVCBitstreamHeader(vlVaContext *context, vlVaBuffer *buf) /* We know the POCs for all LTRs from slice header, fill the LTR ref pic * set with them. */ for (uint8_t i = 0; i < ltr_idx; i++) { - for (uint8_t j = 0; j < sizeof(pic->PicOrderCntVal); ++j) { + for (uint8_t j = 0; j < 15; ++j) { + if (!pic->ref[j]) + continue; uint32_t refpoc = pic->PicOrderCntVal[j]; if ((ltr_tmp[i].msb && ltr_tmp[i].poc == refpoc) || (!ltr_tmp[i].msb && ltr_tmp[i].poc == refpoc % max_poc)) {