mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
st/mesa: add null pointer check in st_texture_image_map()
If we failed to allocate a memory resource for the texture we'd crash when we tried to map it. Now we propogate the NULL back up to the texstore code and generate GL_OUT_OF_MEMORY. Fixes a crash with the upcoming piglit max-texture-size test. NOTE: This is a candidate for the 8.0 branch. Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
parent
c3fe44c5f9
commit
03f8a97d71
1 changed files with 3 additions and 0 deletions
|
|
@ -222,6 +222,9 @@ st_texture_image_map(struct st_context *st, struct st_texture_image *stImage,
|
|||
|
||||
DBG("%s \n", __FUNCTION__);
|
||||
|
||||
if (!stImage->pt)
|
||||
return NULL;
|
||||
|
||||
if (stObj->pt != stImage->pt)
|
||||
level = 0;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue