radeonsi/vcn: fix maybe uninitialized

Detected when working on adding support for Undefined Behaviour
Sanitizer, this fixes:

```
../src/gallium/drivers/radeonsi/radeon_vcn_dec.c: In function 'get_h264_msg':
../src/gallium/drivers/radeonsi/radeon_vcn_dec.c:239:50: error: 'k' may be used uninitialized [-Werror=maybe-uninitialized]
  239 |                                            && (k == ARRAY_SIZE(dec->h264_valid_poc_num))) {
      |                                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/gallium/drivers/radeonsi/radeon_vcn_dec.c:77:19: note: 'k' was declared here
   77 |    unsigned i, j, k;
      |                   ^
cc1: all warnings being treated as errors
```

Reviewed-by: David Rosca <david.rosca@amd.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30880>
This commit is contained in:
Juan A. Suarez Romero
2024-08-27 20:34:46 +02:00
committed by Marge Bot
parent 9d6c667151
commit 0114d293fc

View File

@@ -235,12 +235,11 @@ static rvcn_dec_message_avc_t get_h264_msg(struct radeon_decoder *dec,
|| dec->h264_valid_poc_num[k] == result.field_order_cnt_list[i][1]))
break;
}
}
if (result.ref_frame_list[i] != 0xff && (j == ARRAY_SIZE(dec->h264_valid_ref_num))
&& (k == ARRAY_SIZE(dec->h264_valid_poc_num))) {
result.non_existing_frame_flags |= 1 << i;
result.curr_pic_ref_frame_num--;
result.ref_frame_list[i] = 0xff;
if ((j == ARRAY_SIZE(dec->h264_valid_ref_num)) && (k == ARRAY_SIZE(dec->h264_valid_poc_num))) {
result.non_existing_frame_flags |= 1 << i;
result.curr_pic_ref_frame_num--;
result.ref_frame_list[i] = 0xff;
}
}
}