gl: Avoid a crash in the texture library
authorMatthias Clasen <mclasen@redhat.com>
Sun, 12 Feb 2023 15:01:11 +0000 (10:01 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 12 Feb 2023 15:01:11 +0000 (10:01 -0500)
entry->texture can be NULL, so check before
using it.

Fixes: #5175
gsk/gl/gskgltexturelibrary.c

index c2ec0f84ab1ee2166c812dd681b47ec3ebbc4439..6cbd7fa32a02036feea0940a82fe665b85939b79 100644 (file)
@@ -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++;
                 }