From a75a7fadabf40eb08f2c0a051e723732f7eb84c2 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. --- cogl/cogl-material-opengl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogl/cogl-material-opengl.c b/cogl/cogl-material-opengl.c index d7f7f03c8..51a8288af 100644 --- a/cogl/cogl-material-opengl.c +++ b/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