mesa: fix glBitmap in display lists when width <= 0 || height <= 0

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8904
Fixes: bb860f63 - mesa: create glBitmap textures while creating display lists

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23335>
(cherry picked from commit bac1c88ea3)
This commit is contained in:
Marek Olšák 2023-05-31 11:09:03 -04:00 committed by Eric Engestrom
parent a1a71c0857
commit c2f0fd28ac
2 changed files with 9 additions and 6 deletions

View file

@ -3325,7 +3325,7 @@
"description": "mesa: fix glBitmap in display lists when width <= 0 || height <= 0",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "bb860f63f6df60a00c5a97df4cb98a2e0850d3aa"
},

View file

@ -1345,12 +1345,15 @@ save_Bitmap(GLsizei width, GLsizei height,
GET_CURRENT_CONTEXT(ctx);
Node *n;
ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
struct pipe_resource *tex =
st_make_bitmap_texture(ctx, width, height, &ctx->Unpack, pixels);
struct pipe_resource *tex = NULL;
if (!tex) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glNewList -> glBitmap");
return;
if (width > 0 && height > 0) {
tex = st_make_bitmap_texture(ctx, width, height, &ctx->Unpack, pixels);
if (!tex) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glNewList -> glBitmap");
return;
}
}
n = alloc_instruction(ctx, OPCODE_BITMAP, 6 + POINTER_DWORDS);