evas-wayland-egl: Make sure surface pointer is valid before using it
authorBenjamin Jacobs <benj@spam.thsi.be>
Thu, 9 Jun 2016 13:31:40 +0000 (09:31 -0400)
committerChris Michael <cpmichael@osg.samsung.com>
Thu, 9 Jun 2016 13:33:16 +0000 (09:33 -0400)
Summary:
Prevents the uninitialized surface pointer to be used when
glsym_evgl_native_surface_buffer_get is NULL.

Reviewers: devilhorns

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4016

@fix

src/modules/evas/engines/wayland_egl/evas_engine.c

index 1252e91..c35c6dd 100644 (file)
@@ -871,14 +871,14 @@ _native_cb_bind(void *image)
      }
    else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
      {
-        if (n->ns_data.evasgl.surface)
+        if (n->ns_data.evasgl.surface && glsym_evgl_native_surface_buffer_get)
           {
              Eina_Bool is_egl_image = EINA_FALSE;
              void *surface;
 
-             if (glsym_evgl_native_surface_buffer_get)
-               surface = glsym_evgl_native_surface_buffer_get(n->ns_data.evasgl.surface, &is_egl_image);
-
+             surface =
+               glsym_evgl_native_surface_buffer_get(n->ns_data.evasgl.surface,
+                                                    &is_egl_image);
              if (is_egl_image)
                {
                   if (glsym_glEGLImageTargetTexture2DOES)