From 0e2880b067e96ff93deec6c3a6ffb7aa0cd4cee4 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sun, 8 Aug 2010 13:05:40 +0100 Subject: [PATCH] material: don't dereference layer->texture directly In _cogl_material_texture_storage_change_notify we were potentially dereferencing layer->texture without checking first that it is the authority of texture state. We now use _cogl_material_layer_get_texture() instead. --- clutter/cogl/cogl/cogl-material-opengl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/cogl/cogl/cogl-material-opengl.c b/clutter/cogl/cogl/cogl-material-opengl.c index d7f7f03c8..51a8288af 100644 --- a/clutter/cogl/cogl/cogl-material-opengl.c +++ b/clutter/cogl/cogl/cogl-material-opengl.c @@ -258,7 +258,7 @@ _cogl_delete_gl_texture (GLuint gl_texture) /* Whenever the underlying GL texture storage of a CoglTexture is * changed (e.g. due to migration out of a texture atlas) then we are * notified. This lets us ensure that we reflush that texture's state - * if it reused again with the same texture unit. + * if it is reused again with the same texture unit. */ void _cogl_material_texture_storage_change_notify (CoglHandle texture) @@ -273,7 +273,7 @@ _cogl_material_texture_storage_change_notify (CoglHandle texture) &g_array_index (ctx->texture_units, CoglTextureUnit, i); if (unit->layer && - unit->layer->texture == texture) + _cogl_material_layer_get_texture (unit->layer) == texture) unit->texture_storage_changed = TRUE; /* NB: the texture may be bound to multiple texture units so