Page MenuHomePhabricator

File Metadata

Author
raster
Created
Dec 2 2019, 1:48 AM

tryme.diff

diff --git a/src/lib/emile/emile_image.c b/src/lib/emile/emile_image.c
index 4f6e11905e..5850eeb9ac 100644
--- a/src/lib/emile/emile_image.c
+++ b/src/lib/emile/emile_image.c
@@ -1750,8 +1750,8 @@ _emile_jpeg_data(Emile_Image *image,
uint8_t *ptr, *line[16], *data;
volatile uint32_t *ptr2 = NULL;
uint32_t *ptr_rotate = NULL;
- uint16_t *ptrag = NULL, *ptrag_rotate = NULL;
- uint8_t *ptrg = NULL, *ptrg_rotate = NULL;
+ uint16_t *ptrag = NULL, *ptrag2 = NULL, *ptrag_rotate = NULL;
+ uint8_t *ptrg = NULL, *ptrg2 = NULL, *ptrg_rotate = NULL;
unsigned int y, l, i, scans;
volatile int region = 0;
/* rotation setting */
@@ -1957,12 +1957,14 @@ _emile_jpeg_data(Emile_Image *image,
if (prop->cspace == EMILE_COLORSPACE_GRY8)
{
ptrg = malloc(w * h * sizeof(uint8_t));
+ ptrg2 = ptrg;
ptrg_rotate = ptrg;
ptrg_free = EINA_TRUE;
}
else if (prop->cspace == EMILE_COLORSPACE_AGRY88)
{
ptrag = malloc(w * h * sizeof(uint16_t));
+ ptrag2 = ptrag;
ptrag_rotate = ptrag;
ptrag_free = EINA_TRUE;
}
@@ -2132,10 +2134,10 @@ _emile_jpeg_data(Emile_Image *image,
switch (prop->cspace)
{
case EMILE_COLORSPACE_GRY8:
- _jpeg_gry8_convert_copy(&ptrg, &ptr, w);
+ _jpeg_gry8_convert_copy(&ptrg2, &ptr, w);
break;
case EMILE_COLORSPACE_AGRY88:
- _jpeg_agry88_convert_copy(&ptrag, &ptr, w);
+ _jpeg_agry88_convert_copy(&ptrag2, &ptr, w);
break;
default:
_jpeg_argb8888_convert_copy(&ptr2, &ptr, w);
@@ -2168,10 +2170,10 @@ _emile_jpeg_data(Emile_Image *image,
switch (prop->cspace)
{
case EMILE_COLORSPACE_GRY8:
- _jpeg_gry8_convert_copy(&ptrg, &ptr, opts_region.w);
+ _jpeg_gry8_convert_copy(&ptrg2, &ptr, opts_region.w);
break;
case EMILE_COLORSPACE_AGRY88:
- _jpeg_agry88_convert_copy(&ptrag, &ptr, opts_region.w);
+ _jpeg_agry88_convert_copy(&ptrag2, &ptr, opts_region.w);
break;
default:
_jpeg_argb8888_convert_copy(&ptr2, &ptr, opts_region.w);

Thanks for the patch.
it crashes elsewhere.

Thread 1 "svisionneuse-bi" received signal SIGSEGV, Segmentation fault.
0x00007efe593644c1 in _jpeg_gry8_convert_copy (w=<optimized out>, src=<optimized out>, dst=<optimized out>) at ../src/lib/emile/emile_image.c:1674
1674	../src/lib/emile/emile_image.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  0x00007efe593644c1 in _jpeg_gry8_convert_copy (w=<optimized out>, src=<optimized out>, dst=<optimized out>) at ../src/lib/emile/emile_image.c:1674
#1  _emile_jpeg_data (image=0x557f018575f0, prop=0x7fff2b2f55b0, property_size=<optimized out>, pixels=0x557f0167c930, error=0x7fff2b2f55ac) at ../src/lib/emile/emile_image.c:2173
#2  0x00007efe595a474e in eet_data_image_jpeg_alpha_decode (cspace=EMILE_COLORSPACE_ARGB8888, h=51, w=128, pixels=0x7efe4a8ab000, src_y=0, src_x=0, size=<optimized out>, data=<optimized out>) at ../src/lib/eet/eet_image.c:471
#3  _eet_data_image_decode_inside (data=data@entry=0x7efe4a916090, size=size@entry=844, src_x=src_x@entry=0, src_y=src_y@entry=0, src_w=<optimized out>, src_h=<optimized out>, d=0x7efe4a8ab000, w=128, h=51, row_stride=512, 
    alpha=1, comp=0, quality=75, lossy=EMILE_IMAGE_JPEG, cspace=EMILE_COLORSPACE_ARGB8888) at ../src/lib/eet/eet_image.c:2040
#4  0x00007efe595a5838 in eet_data_image_decode_to_cspace_surface_cipher (data=0x7efe4a916090, cipher_key=cipher_key@entry=0x0, size=844, src_x=src_x@entry=0, src_y=src_y@entry=0, d=d@entry=0x7efe4a8ab000, w=128, h=51, 
    row_stride=512, cspace=EMILE_COLORSPACE_ARGB8888, alpha=0x7fff2b2f5898, comp=0x7fff2b2f589c, quality=0x7fff2b2f58a0, lossy=0x7fff2b2f58a4) at ../src/lib/eet/eet_image.c:2220
#5  0x00007efe595a5a23 in eet_data_image_read_to_cspace_surface_cipher (ef=0x557f0180e230, name=0x557f0159147c "/thumbnail/data", cipher_key=cipher_key@entry=0x0, src_x=src_x@entry=0, src_y=src_y@entry=0, 
    d=d@entry=0x7efe4a8ab000, w=128, h=51, row_stride=512, cspace=EMILE_COLORSPACE_ARGB8888, alpha=0x7fff2b2f5898, comp=0x7fff2b2f589c, quality=0x7fff2b2f58a0, lossy=0x7fff2b2f58a4) at ../src/lib/eet/eet_image.c:1453
#6  0x00007efe5b5edd74 in evas_image_load_file_data_eet (loader_data=<optimized out>, prop=0x7fff2b2f58e0, pixels=0x7efe4a8ab000, error=0x7fff2b2f58dc) at ../src/modules/evas/image_loaders/eet/evas_image_load_eet.c:188
#7  0x00007efe5b494a53 in evas_common_load_rgba_image_data_from_file (ie=0x557f018803a0) at ../src/lib/evas/common/evas_image_load.c:484
#8  0x00007efe5b5dbdd2 in evas_cache_image_load_data (im=0x557f018803a0) at ../src/lib/evas/cache/evas_cache_image.c:1165
#9  0x00007efe42be1e05 in eng_image_data_get (engine=0x557f010333c0, image=0x557f00e007e0, to_write=<optimized out>, image_data=0x7fff2b2f5bc0, err=0x7fff2b2f5bbc, tofree=0x7fff2b2f5bb7 "")
    at ../src/modules/evas/engines/gl_generic/evas_engine.c:959
#10 0x00007efe5b4e4fd9 in evas_object_image_data_get (eo_obj=eo_obj@entry=0x4000002c5b3d, for_writing=for_writing@entry=0 '\000') at ../src/lib/evas/canvas/evas_image_legacy.c:735
#11 0x0000557eff2c5742 in ecore_evas_object_image_image_evas_copy (orig=0x4000002c5b3d, dst=dst@entry=0x4000002cc743) at image_utils.c:80
#12 0x0000557eff2cd3f2 in grid_icon_get_x (data=0x557f014a2530, obj=<optimized out>, part=<optimized out>) at principale.c:508
#13 0x00007efe5cb8b16c in ?? () from target:/usr/lib/x86_64-linux-gnu/libelementary.so.1
#14 0x00007efe5cb8b44a in ?? () from target:/usr/lib/x86_64-linux-gnu/libelementary.so.1
#15 0x00007efe5cb9159d in ?? () from target:/usr/lib/x86_64-linux-gnu/libelementary.so.1
#16 0x00007efe5cb84a24 in elm_obj_gengrid_item_update () from target:/usr/lib/x86_64-linux-gnu/libelementary.so.1
#17 0x00007efe58ed74c3 in ?? () from target:/usr/lib/x86_64-linux-gnu/libeo.so.1
#18 0x00007efe58ed1034 in efl_event_callback_legacy_call () from target:/usr/lib/x86_64-linux-gnu/libeo.so.1
#19 0x00007efe5db7a85a in e_thumb_client_data () from target:/usr/lib/x86_64-linux-gnu/libethumbnailer.so.0
#20 0x00007efe5db799bf in ?? () from target:/usr/lib/x86_64-linux-gnu/libethumbnailer.so.0
#21 0x00007efe59e62440 in ?? () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#22 0x00007efe59e6b07c in efl_loop_message_handler_message_call () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#23 0x00007efe59e6449d in ?? () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#24 0x00007efe59e63304 in efl_loop_message_process () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#25 0x00007efe59e5ed7c in ?? () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#26 0x00007efe59e5f54d in ?? () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#27 0x00007efe59e642e5 in ?? () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#28 0x00007efe59e635a4 in efl_loop_begin () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#29 0x00007efe59e5f627 in ecore_main_loop_begin () from target:/usr/lib/x86_64-linux-gnu/libecore.so.1
#30 0x0000557eff2d32cb in elm_main (argc=<optimized out>, argv=<optimized out>) at svisionneuse.c:938
#31 0x0000557eff2bee6c in main (argc=1, argv=0x7fff2b2f7538) at svisionneuse.c:953
raster added a comment.Dec 2 2019, 6:08 AM

try this instead:

F3807262

It's fixed, nice work!
Thank you:)