Fix unitialized first_pixels for foreign textures

tex->first_pixels was never set for foreign textures, leading
to a crash when the texture object is freed.

As a quick fix, simply set to NULL. A more complete fix would
require remembering if we had ever seen the first pixel uploaded,
and if not, doing a glReadPixel to get it before triggering the
mipmap update.

http://bugzilla.openedhand.com/show_bug.cgi?id=1645

Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Owen W. Taylor 2009-06-08 16:45:43 -04:00 committed by Neil Roberts
parent 08d580f68a
commit 1d7a7bf1e6
2 changed files with 4 additions and 0 deletions

View File

@ -1600,6 +1600,8 @@ cogl_texture_new_from_foreign (GLuint gl_handle,
g_array_append_val (tex->slice_gl_handles, gl_handle);
tex->first_pixels = NULL;
return _cogl_texture_handle_new (tex);
}

View File

@ -1676,6 +1676,8 @@ cogl_texture_new_from_foreign (GLuint gl_handle,
g_array_append_val (tex->slice_gl_handles, gl_handle);
tex->first_pixels = NULL;
return _cogl_texture_handle_new (tex);
}