Evas masking: Fix potential crash
authorJean-Philippe Andre <jp.andre@samsung.com>
Thu, 22 Jan 2015 07:39:03 +0000 (16:39 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Thu, 22 Jan 2015 07:39:03 +0000 (16:39 +0900)
This adjusts the clip to match the mask image data.
To be fair, I'm not sure in which situation those two
don't match well. This patch fixes a rare crash.

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

index 95032e2..4ddf80a 100644 (file)
@@ -457,6 +457,9 @@ eng_context_clip_image_set(void *data EINA_UNUSED, void *context, void *surface,
         else
 #endif
           evas_cache_image_ref(ie);
+
+        RECTS_CLIP_TO_RECT(ctx->clip.x, ctx->clip.y, ctx->clip.w, ctx->clip.h,
+                           x, y, ie->w, ie->h);
      }
 }