mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-06-06 22:18:24 +02:00
glamor: fix an error path cleanup
The GL_OUT_OF_MEMORY error path returns NULL without freeing the allocated `bits` buffer or deleting the GL texture. Assisted-by: Claude:claude-opus-4-6
This commit is contained in:
parent
66c4a2a6af
commit
8d74c4ebde
1 changed files with 6 additions and 3 deletions
|
|
@ -160,11 +160,14 @@ glamor_font_get(ScreenPtr screen, FontPtr font)
|
|||
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8UI, overall_width, overall_height,
|
||||
0, GL_RED_INTEGER, GL_UNSIGNED_BYTE, bits);
|
||||
glamor_priv->suppress_gl_out_of_memory_logging = false;
|
||||
if (glGetError() == GL_OUT_OF_MEMORY)
|
||||
return NULL;
|
||||
|
||||
free(bits);
|
||||
|
||||
if (glGetError() == GL_OUT_OF_MEMORY) {
|
||||
glDeleteTextures(1, &glamor_font->texture_id);
|
||||
glamor_font->texture_id = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
glamor_font->realized = TRUE;
|
||||
|
||||
return glamor_font;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue