hi,

as discussed on the #edevelop channel today, I had a segfault using
evas while doing load_size_set. before that I had a previously loaded
image and did file_set.

the segfault was caused by a null ptr in the image cache (below is the
gdb output). the src flags of the rgba_image was RGBA_IMAGE_NOTHING
and there was no check if the file was loaded before.

cedric proposed a solution that is attached in this patch, but he was
not sure if there could be any situation where a rgba_image with no
data set could not be a file. if this may happen this patch will be
wrong.

gdb output of the segfault:

#Program received signal SIGSEGV, Segmentation fault.
#[Switching to Thread -1210279728 (LWP 27868)]
#0xb7c0af58 in evas_common_copy_pixels_c (src=0x0, dst=0xb6b64008,
len=507) at evas_blit_main.c:135
#135             *dst++ = *src++;
#(gdb) bt
#
#0  0xb7c0af58 in evas_common_copy_pixels_c (src=0x0, dst=0xb6b64008,
len=507) at evas_blit_main.c:135
#
#1  0xb7c0b0ec in evas_common_copy_pixels_mmx2 (src=0x0,
dst=0xb6b64008, len=507) at evas_blit_main.c:198
#
#2  0xb7c0aec8 in evas_common_blit_rectangle (src=0x82f3c00,
dst=0x833eef8, src_x=0, src_y=0, w=507, h=337, dst_x=0, dst_y=0) at
evas_blit_main.c:110
#
#3  0xb7c30913 in _evas_common_image_dirty (dst=0x833eef8,
src=0x82f3c00) at evas_image_main.c:137
#
#4  0xb7bf7aac in evas_cache_image_dirty (im=0x82f3c00, x=0, y=0,
w=507, h=337) at evas_cache_image.c:322
#
#5  0xb76640c9 in eng_image_dirty_region (data=0x8249368,
image=0x82f3c00, x=0, y=0, w=507, h=337) at evas_engine.c:516
#
#6  0xb7bd1582 in evas_object_image_unload (obj=0x833b8c8) at
evas_object_image.c:1664
#
#7  0xb7bd09f5 in evas_object_image_load_size_set (obj=0x833b8c8,
w=507, h=337) at evas_object_image.c:1376
#
#8  0xb775ad83 in __pyx_f_4evas_6c_evas_5Image_load_size_set
(__pyx_v_self=0xb772005c, __pyx_args=0x82b296c, __pyx_kwds=0x0) at
evas/evas.c_evas.c:32053


br,
-- 
// leo

-------------------------------------------------------
Leonardo Sobral Cunha
OpenBossa Labs
INdT - Instituto Nokia de Tecnologia
PGP: 0x5751676C @ wwwkeys.pgp.net
-------------------------------------------------------
Index: src/lib/engines/common/evas_image_main.c
===================================================================
RCS file: /var/cvs/e/e17/libs/evas/src/lib/engines/common/evas_image_main.c,v
retrieving revision 1.56
diff -u -p -u -p -r1.56 evas_image_main.c
--- src/lib/engines/common/evas_image_main.c	22 Aug 2007 15:06:04 -0000	1.56
+++ src/lib/engines/common/evas_image_main.c	17 Oct 2007 18:09:51 -0000
@@ -132,6 +132,8 @@ evas_common_image_delete(RGBA_Image* im)
 static int
 _evas_common_image_dirty(RGBA_Image* dst, const RGBA_Image* src)
 {
+   evas_common_load_image_data_from_file(src);
+   evas_common_image_colorspace_normalize(src);
    evas_common_image_colorspace_normalize(dst);
    evas_common_image_surface_alloc(dst->image);
    evas_common_blit_rectangle(src, dst, 0, 0, src->image->w, src->image->h, 0, 0);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to