../src/gallium/auxiliary/vl/vl_winsys_dri.c: In function ‘vl_dri2_screen_texture_from_drawable’:
../src/gallium/auxiliary/vl/vl_winsys_dri.c:239:34: warning: ‘back_left’ may be used uninitialized in this function [-Wmaybe-uninitialized]
239 | dri2_handle.stride = back_left->pitch;
The server would be broken if it failed to inform us of the back left
buffer, but let's leave nothing to chance.
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8724>
struct pipe_resource templ, *tex;
xcb_dri2_get_buffers_reply_t *reply;
- xcb_dri2_dri2_buffer_t *buffers, *back_left;
+ xcb_dri2_dri2_buffer_t *buffers, *back_left = NULL;
unsigned depth = ((xcb_screen_t *)(vscreen->xcb_screen))->root_depth;
unsigned i;
}
}
- if (i == reply->count) {
+ if (i == reply->count || !back_left) {
free(reply);
return NULL;
}