mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
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:
parent
9d6c667151
commit
0114d293fc
1 changed files with 5 additions and 6 deletions
|
|
@ -235,14 +235,13 @@ 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]))
|
|| dec->h264_valid_poc_num[k] == result.field_order_cnt_list[i][1]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
if ((j == ARRAY_SIZE(dec->h264_valid_ref_num)) && (k == ARRAY_SIZE(dec->h264_valid_poc_num))) {
|
||||||
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.non_existing_frame_flags |= 1 << i;
|
||||||
result.curr_pic_ref_frame_num--;
|
result.curr_pic_ref_frame_num--;
|
||||||
result.ref_frame_list[i] = 0xff;
|
result.ref_frame_list[i] = 0xff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* need at least one reference for P/B frames */
|
/* need at least one reference for P/B frames */
|
||||||
if (result.curr_pic_ref_frame_num == 0 && pic->slice_parameter.slice_info_present) {
|
if (result.curr_pic_ref_frame_num == 0 && pic->slice_parameter.slice_info_present) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue