summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_draw_main.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-10-04 16:50:58 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-10-04 16:58:42 +0900
commit8a4ddea224ee2cc411269024311691cf8841a2bc (patch)
tree073d3d59b3347ae7aca766608d6146179aadc644 /src/lib/evas/common/evas_draw_main.c
parent82095adae4d17fc4d04d490d478771d9e1be0006 (diff)
evas render - async sw - fix context duplication by using proper dup call
valgrind pointed this one out. we access freed memory when we dup a context because the context CONTAINS ptrs to things like rects for cutouts. we didnt dup these. use the proper context dup call (and properly ref pixman color image too). this was a random bug/crash waiting to happen and valgrind caught it. suprising it hasnt turned up before :/ @fix
Diffstat (limited to 'src/lib/evas/common/evas_draw_main.c')
-rw-r--r--src/lib/evas/common/evas_draw_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c
index 3a62d94..b444608 100644
--- a/src/lib/evas/common/evas_draw_main.c
+++ b/src/lib/evas/common/evas_draw_main.c
@@ -107,6 +107,12 @@ evas_common_draw_context_dup(RGBA_Draw_Context *dc)
107 dc2 = malloc(sizeof(RGBA_Draw_Context)); 107 dc2 = malloc(sizeof(RGBA_Draw_Context));
108 memcpy(dc2, dc, sizeof(RGBA_Draw_Context)); 108 memcpy(dc2, dc, sizeof(RGBA_Draw_Context));
109 evas_common_draw_context_cutouts_dup(&dc2->cutout, &dc->cutout); 109 evas_common_draw_context_cutouts_dup(&dc2->cutout, &dc->cutout);
110#ifdef HAVE_PIXMAN
111#if defined(PIXMAN_FONT) || defined(PIXMAN_RECT) || defined(PIXMAN_LINE) || defined(PIXMAN_POLY)
112 if (dc2->col.pixman_color_image)
113 pixman_image_ref(dc2->col.pixman_color_image);
114#endif
115#endif
110 return dc2; 116 return dc2;
111} 117}
112 118