Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/engines/common_16 Modified Files: evas_soft16_image_scaled_sampled.c evas_soft16_main.c Log Message: cover up segv where somehow the alpha flag is set in the 16bit engine but the alpha pixel pointer is NULL. couldn't see where that happens, but it's now protected against it. =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_image_scaled_sampled.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- evas_soft16_image_scaled_sampled.c 3 Jun 2008 14:45:38 -0000 1.2 +++ evas_soft16_image_scaled_sampled.c 2 Jul 2008 00:57:26 -0000 1.3 @@ -93,10 +93,11 @@ int dst_offset, int w, int h, int *offset_x, int *offset_y) { - if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) + if ((src->cache_entry.flags.alpha && src->alpha) && + (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid (src, dst, dc, dst_offset, w, h, offset_x, offset_y); - else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) + else if (!dst->cache_entry.flags.alpha) _soft16_image_draw_scaled_solid_solid (src, dst, dc, dst_offset, w, h, offset_x, offset_y); else @@ -205,10 +206,11 @@ int dst_offset, int w, int h, int *offset_x, int *offset_y, DATA8 a) { - if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) + if ((src->cache_entry.flags.alpha && src->alpha) && + (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid_mul_alpha (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a); - else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) + else if (!dst->cache_entry.flags.alpha) _soft16_image_draw_scaled_solid_solid_mul_alpha (src, dst, dc, dst_offset, w, h, offset_x, offset_y, a); else @@ -387,10 +389,11 @@ int *offset_x, int *offset_y, DATA8 r, DATA8 g, DATA8 b, DATA8 a) { - if (src->cache_entry.flags.alpha && (!dst->cache_entry.flags.alpha)) + if ((src->cache_entry.flags.alpha && src->alpha) && + (!dst->cache_entry.flags.alpha)) _soft16_image_draw_scaled_transp_solid_mul_color (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a); - else if ((!src->cache_entry.flags.alpha) && (!dst->cache_entry.flags.alpha)) + else if (!dst->cache_entry.flags.alpha) _soft16_image_draw_scaled_solid_solid_mul_color (src, dst, dc, dst_offset, w, h, offset_x, offset_y, r, g, b, a); else =================================================================== RCS file: /cvs/e/e17/libs/evas/src/lib/engines/common_16/evas_soft16_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- evas_soft16_main.c 3 Jun 2008 14:45:38 -0000 1.4 +++ evas_soft16_main.c 2 Jul 2008 00:57:26 -0000 1.5 @@ -94,16 +94,10 @@ { Soft16_Image *im; - im = malloc(sizeof (Soft16_Image)); + im = calloc(1, sizeof(Soft16_Image)); if (!im) return NULL; im->stride = -1; - im->pixels = NULL; - im->alpha = NULL; - /* When is have_alpha set ? */ -/* im->flags.have_alpha = 0; */ - im->flags.free_pixels = 0; - im->flags.free_alpha = 0; return (Image_Entry *) im; } ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs