summaryrefslogtreecommitdiff
path: root/gsk
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2023-02-12 10:01:11 -0500
committerMatthias Clasen <mclasen@redhat.com>2023-02-12 10:01:11 -0500
commitd3dfdd214fc8114c299822fb80b98b23b035f01d (patch)
treeebbdc1acd0eac84b52f745f1f299f6c933bf09ad /gsk
parentb6c3cf4eee7af05d7bd5ce4fd9f421a2ae03d60b (diff)
downloadgtk+-d3dfdd214fc8114c299822fb80b98b23b035f01d.tar.gz
gl: Avoid a crash in the texture library
entry->texture can be NULL, so check before using it. Fixes: #5175
Diffstat (limited to 'gsk')
-rw-r--r--gsk/gl/gskgltexturelibrary.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gsk/gl/gskgltexturelibrary.c b/gsk/gl/gskgltexturelibrary.c
index c2ec0f84ab..6cbd7fa32a 100644
--- a/gsk/gl/gskgltexturelibrary.c
+++ b/gsk/gl/gskgltexturelibrary.c
@@ -112,7 +112,8 @@ gsk_gl_texture_library_real_compact (GskGLTextureLibrary *self,
{
if (!entry->accessed)
{
- gsk_gl_driver_release_texture (self->driver, entry->texture);
+ if (entry->texture)
+ gsk_gl_driver_release_texture (self->driver, entry->texture);
g_hash_table_iter_remove (&iter);
dropped++;
}