mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 02:20:13 +01:00
tests/client-buffer: fix false-positive uninitialized variables
GCC 14.2 with debugoptimized build complained:
../../git/weston/tests/client-buffer-test.c: In function ‘y_u_v_create_buffer’:
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘u_row’ may be used uninitialized [-Werror=maybe-uninitialized]
1045 | x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1046 | u_row + x / pixel_format_hsub(buf->fmt, 1),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1047 | v_row + x / pixel_format_hsub(buf->fmt, 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:986:18: note: ‘u_row’ was declared here
986 | uint8_t *u_row;
| ^~~~~
../../git/weston/tests/client-buffer-test.c:1045:33: error: ‘v_row’ may be used uninitialized [-Werror=maybe-uninitialized]
1045 | x8r8g8b8_to_ycbcr8_bt709(argb, y_row + x,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1046 | u_row + x / pixel_format_hsub(buf->fmt, 1),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1047 | v_row + x / pixel_format_hsub(buf->fmt, 1));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../git/weston/tests/client-buffer-test.c:987:18: note: ‘v_row’ was declared here
987 | uint8_t *v_row;
| ^~~~~
The debug build did not complain.
Even though only u_row and v_row were reported, I don't understand why
there is no warning about u_base and v_base, as they are initialized
with a similar switch. So initialize them too, just in case.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
parent
c23d028300
commit
92c15464aa
1 changed files with 4 additions and 4 deletions
|
|
@ -980,11 +980,11 @@ y_u_v_create_buffer(struct client *client,
|
|||
int x, y;
|
||||
uint32_t *rgb_row;
|
||||
uint8_t *y_base;
|
||||
uint8_t *u_base;
|
||||
uint8_t *v_base;
|
||||
uint8_t *u_base = NULL;
|
||||
uint8_t *v_base = NULL;
|
||||
uint8_t *y_row;
|
||||
uint8_t *u_row;
|
||||
uint8_t *v_row;
|
||||
uint8_t *u_row = NULL;
|
||||
uint8_t *v_row = NULL;
|
||||
uint32_t argb;
|
||||
|
||||
buf = client_buffer_create(client, &args);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue