summaryrefslogtreecommitdiff
path: root/cogl/cogl-texture-2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'cogl/cogl-texture-2d.c')
-rw-r--r--cogl/cogl-texture-2d.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cogl/cogl-texture-2d.c b/cogl/cogl-texture-2d.c
index 28f32e09..94b34eff 100644
--- a/cogl/cogl-texture-2d.c
+++ b/cogl/cogl-texture-2d.c
@@ -241,6 +241,7 @@ _cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
CoglError **error)
{
CoglTextureLoader *loader;
+ CoglTexture2D *tex;
_COGL_RETURN_VAL_IF_FAIL (_cogl_context_get_winsys (ctx)->constraints &
COGL_RENDERER_CONSTRAINT_USES_EGL,
@@ -258,7 +259,15 @@ _cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
loader->src.egl_image.height = height;
loader->src.egl_image.format = format;
- return _cogl_texture_2d_create_base (ctx, width, height, format, loader);
+ tex = _cogl_texture_2d_create_base (ctx, width, height, format, loader);
+
+ if (!cogl_texture_allocate (COGL_TEXTURE (tex), error))
+ {
+ cogl_object_unref (tex);
+ return NULL;
+ }
+
+ return tex;
}
#endif /* defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base) */