antognolli pushed a commit to branch master.

commit de5b36583dceea9c88357bea71aaf1677c85f8ae
Author: Rafael Antognolli <[email protected]>
Date:   Fri Mar 8 14:50:02 2013 -0300

    evas/wayland_shm: Change the buffer sent comparison.
    
    Using the wb->buffer pointer to compare if a buffer was already sent is
    bad, since the buffer pointer can be changed in a way that that
    comparison is true, even if different buffers are used.
    
    When requesting a new buffer to the wl_shm_pool, it can return the
    buffer address of a previously freed buffer. This reused buffer pointer
    can be the same as the last buffer sent to the compositor, and the
    comparison will be true, skipping a new wl_buffer_attach.
---
 src/modules/evas/engines/wayland_shm/evas_swapper.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/modules/evas/engines/wayland_shm/evas_swapper.c 
b/src/modules/evas/engines/wayland_shm/evas_swapper.c
index d7cf6e6..49d7cce 100644
--- a/src/modules/evas/engines/wayland_shm/evas_swapper.c
+++ b/src/modules/evas/engines/wayland_shm/evas_swapper.c
@@ -427,7 +427,7 @@ static void
 _evas_swapper_buffer_put(Wl_Swapper *ws, Wl_Buffer *wb, Eina_Rectangle *rects, 
unsigned int count)
 {
    Eina_Rectangle *rect;
-   static struct wl_buffer *sent;
+   static Wl_Buffer *sent = NULL;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
@@ -469,12 +469,12 @@ _evas_swapper_buffer_put(Wl_Swapper *ws, Wl_Buffer *wb, 
Eina_Rectangle *rects, u
      }
 
    /* surface attach */
-   if (sent != wb->buffer)
+   if (sent != wb)
      {
         wl_surface_attach(ws->surface, wb->buffer, ws->dx, ws->dy);
         ws->dx = 0;
         ws->dy = 0;
-        sent = wb->buffer;
+        sent = wb;
      }
 
    /* surface damage */

-- 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

Reply via email to