st/mesa: check renderbuffer before using it

rb being NULL is only checked for in the caller if no-error isn't
used.

cc: mesa-stable

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9747
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25209>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2023-09-13 16:28:12 +02:00 committed by Marge Bot
parent af27ecb089
commit 63a3a9b23b

View file

@ -427,6 +427,9 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y,
uint8_t *map = NULL;
int dst_x, dst_y;
if (rb == NULL)
return;
/* Validate state (to be sure we have up-to-date framebuffer surfaces)
* and flush the bitmap cache prior to reading. */
st_validate_state(st, ST_PIPELINE_UPDATE_FB_STATE_MASK);