devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=73ce914020d3084b29194bac9ddabe2b33e952a1

commit 73ce914020d3084b29194bac9ddabe2b33e952a1
Author: MinJeong Kim <minjjj....@samsung.com>
Date:   Wed Aug 27 08:24:26 2014 -0400

    Check whether attached buffer exists, before using it.
    
    Summary:
    Because attached buffer can be NULL for removing surface content,
    check of pending.buffer should be done before getting resource value of the 
buffer.
    
    Reviewers: devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1370
---
 src/bin/e_comp_wl.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index 81e6a0a..1933a48 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -425,7 +425,11 @@ _e_comp_wl_subsurface_commit_from_cache(E_Client *ec)
      {
         e_comp_wl_buffer_reference(&cdata->buffer_ref,
                                     sub_cdata->cached.buffer_ref.buffer);
-        e_pixmap_resource_set(cp, cdata->pending.buffer->resource);
+        if (cdata->pending.buffer)
+          e_pixmap_resource_set(cp,
+                                cdata->pending.buffer->resource);
+        else
+          e_pixmap_resource_set(cp, NULL);
         e_pixmap_usable_set(cp, (cdata->pending.buffer != NULL));
      }
 
@@ -554,8 +558,11 @@ _e_comp_wl_surface_commit(E_Client *ec)
      {
         e_comp_wl_buffer_reference(&ec->comp_data->buffer_ref,
                                     ec->comp_data->pending.buffer);
-
-        e_pixmap_resource_set(cp, ec->comp_data->pending.buffer->resource);
+        if (ec->comp_data->pending.buffer)
+          e_pixmap_resource_set(cp,
+                                ec->comp_data->pending.buffer->resource);
+        else
+          e_pixmap_resource_set(cp, NULL);
         e_pixmap_usable_set(cp, (ec->comp_data->pending.buffer != NULL));
      }
 

-- 


Reply via email to