evas-gl-drm: Trap for invalid gbm bo
authorChris Michael <cp.michael@samsung.com>
Fri, 5 Jun 2015 17:39:41 +0000 (13:39 -0400)
committerChris Michael <cp.michael@samsung.com>
Fri, 5 Jun 2015 17:40:35 +0000 (13:40 -0400)
Summary: If we fail to lock the front buffer, we will not get a valid
bo returned so we should not be calling other functions which require
a bo.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/evas/engines/gl_drm/evas_outbuf.c

index 6a9d7b8..fcb3c61 100644 (file)
@@ -69,6 +69,7 @@ _evas_outbuf_cb_pageflip(void *data)
    if (!(ob = data)) return;
 
    bo = ob->priv.bo[ob->priv.curr];
+   if (!bo) return;
 
    fb = _evas_outbuf_fb_get(ob->info->info.dev, bo);
    if (fb) fb->pending_flip = EINA_FALSE;
@@ -85,6 +86,11 @@ _evas_outbuf_buffer_swap(Outbuf *ob, Eina_Rectangle *rects, unsigned int count)
    Ecore_Drm_Fb *fb;
 
    ob->priv.bo[ob->priv.curr] = gbm_surface_lock_front_buffer(ob->surface);
+   if (!ob->priv.bo[ob->priv.curr])
+     {
+        WRN("Could not lock front buffer: %m");
+        return;
+     }
 
    fb = _evas_outbuf_fb_get(ob->info->info.dev, ob->priv.bo[ob->priv.curr]);
    if (fb)