Evas (Wayland_Shm Engine): Check for valid RGBA_Image before trying to
authordevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Dec 2011 23:12:05 +0000 (23:12 +0000)
committerdevilhorns <devilhorns@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 26 Dec 2011 23:12:05 +0000 (23:12 +0000)
use it. Use correct stride calculation for bytes.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@66539 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/engines/wayland_shm/evas_outbuf.c

index 635cb37..490a978 100644 (file)
@@ -54,8 +54,11 @@ evas_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *c
 
        *cx = 0; *cy = 0; *cw = w; *ch = h;
        im = (RGBA_Image *)evas_cache_image_empty(evas_common_image_cache_get());
-        im->cache_entry.flags.alpha = 1;
-        im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
+        if (im) 
+          {
+             im->cache_entry.flags.alpha = 1;
+             im = (RGBA_Image *)evas_cache_image_size_set(&im->cache_entry, w, h);
+          }
 
         return im;
      }
@@ -77,7 +80,7 @@ evas_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x __UNUSED__
              DATA32 *dst, *src;
              int yy = 0, bytes = 0;
 
-             bytes = (h * (w * sizeof(DATA32)));
+             bytes = ((w * sizeof(int)) * h);
              for (yy = 0; yy < h; yy++) 
                {
                   src = update->image.data + (yy * update->cache_entry.w);