summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/benchmarks/eina/eina_bench_convert.c4
-rw-r--r--src/bin/ethumb_client/ethumbd_slave.c13
-rw-r--r--src/lib/ecore/efl_exe.c13
-rw-r--r--src/lib/ecore/efl_thread.c4
-rw-r--r--src/lib/ecore_con/ecore_con_url.c2
-rw-r--r--src/lib/eina/eina_thread.c5
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c2
-rw-r--r--src/lib/elementary/elm_config.c16
-rw-r--r--src/lib/elementary/elm_priv.h4
-rw-r--r--src/lib/elput/elput_logind.c8
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_node.c10
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c3
-rw-r--r--src/modules/ethumb/emotion/emotion.c5
-rw-r--r--src/modules/evas/image_loaders/psd/evas_image_load_psd.c38
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c34
-rw-r--r--src/static_libs/vg_common/vg_common_svg.c3
-rw-r--r--src/tests/elementary/elm_test_entry.c23
-rw-r--r--src/tests/evas/evas_test_image.c10
18 files changed, 143 insertions, 54 deletions
diff --git a/src/benchmarks/eina/eina_bench_convert.c b/src/benchmarks/eina/eina_bench_convert.c
index aafe9ea3ba..a34ca80f4b 100644
--- a/src/benchmarks/eina/eina_bench_convert.c
+++ b/src/benchmarks/eina/eina_bench_convert.c
@@ -109,8 +109,8 @@ static void
109eina_bench_convert_dtoa(int request) 109eina_bench_convert_dtoa(int request)
110{ 110{
111 char tmp[128]; 111 char tmp[128];
112 long long m; 112 long long m = 0;
113 long e; 113 long e = 0;
114 double r; 114 double r;
115 int i; 115 int i;
116 116
diff --git a/src/bin/ethumb_client/ethumbd_slave.c b/src/bin/ethumb_client/ethumbd_slave.c
index d7b7ff6680..1b805a4bd3 100644
--- a/src/bin/ethumb_client/ethumbd_slave.c
+++ b/src/bin/ethumb_client/ethumbd_slave.c
@@ -119,6 +119,11 @@ _ec_pipe_str_read(struct _Ethumbd_Child *ec EINA_UNUSED, char **str)
119 *str = NULL; 119 *str = NULL;
120 return 0; 120 return 0;
121 } 121 }
122 if ((size < 0) || (size >= PATH_MAX))
123 {
124 *str = NULL;
125 return 0;
126 }
122 127
123 if (!size) 128 if (!size)
124 { 129 {
@@ -178,6 +183,8 @@ _ec_op_new(struct _Ethumbd_Child *ec)
178 r = _ec_read_safe(stdin, &idx, sizeof(idx)); 183 r = _ec_read_safe(stdin, &idx, sizeof(idx));
179 if (!r) 184 if (!r)
180 return 0; 185 return 0;
186 if ((idx < 0) || (idx >= NETHUMBS))
187 return 0;
181 188
182 DBG("ethumbd new(). idx = %d", idx); 189 DBG("ethumbd new(). idx = %d", idx);
183 190
@@ -194,6 +201,8 @@ _ec_op_del(struct _Ethumbd_Child *ec)
194 r = _ec_read_safe(stdin, &idx, sizeof(idx)); 201 r = _ec_read_safe(stdin, &idx, sizeof(idx));
195 if (!r) 202 if (!r)
196 return 0; 203 return 0;
204 if ((idx < 0) || (idx >= NETHUMBS))
205 return 0;
197 206
198 DBG("ethumbd del(). idx = %d", idx); 207 DBG("ethumbd del(). idx = %d", idx);
199 208
@@ -245,6 +254,8 @@ _ec_op_generate(struct _Ethumbd_Child *ec)
245 r = _ec_read_safe(stdin, &idx, sizeof(idx)); 254 r = _ec_read_safe(stdin, &idx, sizeof(idx));
246 if (!r) 255 if (!r)
247 return 0; 256 return 0;
257 if ((idx < 0) || (idx >= NETHUMBS))
258 return 0;
248 259
249 r = _ec_pipe_str_read(ec, &path); 260 r = _ec_pipe_str_read(ec, &path);
250 if (!r) 261 if (!r)
@@ -667,6 +678,8 @@ _ec_op_setup(struct _Ethumbd_Child *ec)
667 r = _ec_read_safe(stdin, &idx, sizeof(idx)); 678 r = _ec_read_safe(stdin, &idx, sizeof(idx));
668 if (!r) 679 if (!r)
669 return 0; 680 return 0;
681 if ((idx < 0) || (idx >= NETHUMBS))
682 return 0;
670 683
671 r = _ec_read_safe(stdin, &type, sizeof(type)); 684 r = _ec_read_safe(stdin, &type, sizeof(type));
672 if (!r) 685 if (!r)
diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c
index 03c52ab845..7239bcdf6f 100644
--- a/src/lib/ecore/efl_exe.c
+++ b/src/lib/ecore/efl_exe.c
@@ -537,13 +537,14 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
537 { 537 {
538 // hide stdin 538 // hide stdin
539 devnull = open("/dev/null", O_RDONLY); 539 devnull = open("/dev/null", O_RDONLY);
540 dup2(devnull, STDIN_FILENO); 540 if (devnull < 0) _exit(1);
541 if (dup2(devnull, STDIN_FILENO) < 0) _exit(1);
541 close(devnull); 542 close(devnull);
542 } 543 }
543 else if ((td->flags & EFL_TASK_FLAGS_USE_STDIN)) 544 else if ((td->flags & EFL_TASK_FLAGS_USE_STDIN))
544 { 545 {
545 // hook up stdin to the pipe going to the parent 546 // hook up stdin to the pipe going to the parent
546 dup2(pipe_stdin[0], STDIN_FILENO); 547 if (dup2(pipe_stdin[0], STDIN_FILENO) < 0) _exit(1);
547 close(pipe_stdin[0]); 548 close(pipe_stdin[0]);
548 } 549 }
549 550
@@ -552,13 +553,14 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
552 { 553 {
553 // hide stdout 554 // hide stdout
554 devnull = open("/dev/null", O_WRONLY); 555 devnull = open("/dev/null", O_WRONLY);
555 dup2(devnull, STDOUT_FILENO); 556 if (devnull < 0) _exit(1);
557 if (dup2(devnull, STDOUT_FILENO) < 0) _exit(1);
556 close(devnull); 558 close(devnull);
557 } 559 }
558 else if ((td->flags & EFL_TASK_FLAGS_USE_STDOUT)) 560 else if ((td->flags & EFL_TASK_FLAGS_USE_STDOUT))
559 { 561 {
560 // hook up stdout to the pipe going to the parent 562 // hook up stdout to the pipe going to the parent
561 dup2(pipe_stdout[1], STDOUT_FILENO); 563 if (dup2(pipe_stdout[1], STDOUT_FILENO) < 0) _exit(1);
562 close(pipe_stdout[1]); 564 close(pipe_stdout[1]);
563 } 565 }
564 566
@@ -566,7 +568,8 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd)
566 { 568 {
567 // hide stderr 569 // hide stderr
568 devnull = open("/dev/null", O_WRONLY); 570 devnull = open("/dev/null", O_WRONLY);
569 dup2(devnull, STDERR_FILENO); 571 if (devnull < 0) _exit(1);
572 if (dup2(devnull, STDERR_FILENO) < 0) _exit(1);
570 close(devnull); 573 close(devnull);
571 } 574 }
572 575
diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c
index ab6fdab7a1..9fc6b8d882 100644
--- a/src/lib/ecore/efl_thread.c
+++ b/src/lib/ecore/efl_thread.c
@@ -826,8 +826,8 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
826 close(pd->fd.out); 826 close(pd->fd.out);
827 close(pd->ctrl.in); 827 close(pd->ctrl.in);
828 close(pd->ctrl.out); 828 close(pd->ctrl.out);
829 close(thdat->fd.in); 829 if (thdat->fd.in >= 0) close(thdat->fd.in);
830 close(thdat->fd.out); 830 if (thdat->fd.out >= 0) close(thdat->fd.out);
831 close(thdat->ctrl.in); 831 close(thdat->ctrl.in);
832 close(thdat->ctrl.out); 832 close(thdat->ctrl.out);
833 free(thdat); 833 free(thdat);
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index b1d95f14f6..1d8d0a5e47 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -49,7 +49,6 @@ ecore_con_url_init(void)
49 if (!ecore_con_init()) goto ecore_con_init_failed; 49 if (!ecore_con_init()) goto ecore_con_init_failed;
50 if (!emile_init()) goto emile_init_failed; 50 if (!emile_init()) goto emile_init_failed;
51 if (!emile_cipher_init()) goto emile_cipher_init_failed; 51 if (!emile_cipher_init()) goto emile_cipher_init_failed;
52 _c_init();
53 ECORE_CON_EVENT_URL_DATA = ecore_event_type_new(); 52 ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
54 ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new(); 53 ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
55 ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new(); 54 ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
@@ -79,7 +78,6 @@ ecore_con_url_shutdown(void)
79 ECORE_CON_EVENT_URL_COMPLETE, 78 ECORE_CON_EVENT_URL_COMPLETE,
80 ECORE_CON_EVENT_URL_PROGRESS); 79 ECORE_CON_EVENT_URL_PROGRESS);
81 80
82 _c_shutdown();
83 emile_shutdown(); /* no emile_cipher_shutdown(), handled here */ 81 emile_shutdown(); /* no emile_cipher_shutdown(), handled here */
84 ecore_con_shutdown(); 82 ecore_con_shutdown();
85 ecore_shutdown(); 83 ecore_shutdown();
diff --git a/src/lib/eina/eina_thread.c b/src/lib/eina/eina_thread.c
index 369711f2d8..18e7ac58d6 100644
--- a/src/lib/eina/eina_thread.c
+++ b/src/lib/eina/eina_thread.c
@@ -66,7 +66,10 @@ _eina_thread_create(Eina_Thread *t, int affinity, void *(*func)(void *data), voi
66 sigset_t oldset, newset; 66 sigset_t oldset, newset;
67#endif 67#endif
68 68
69 pthread_attr_init(&attr); 69 if (pthread_attr_init(&attr) != 0)
70 {
71 return EINA_FALSE;
72 }
70 if (affinity >= 0) 73 if (affinity >= 0)
71 { 74 {
72#ifdef EINA_HAVE_PTHREAD_AFFINITY 75#ifdef EINA_HAVE_PTHREAD_AFFINITY
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 7eb6fe42d1..1a7f0079e0 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1013,7 +1013,7 @@ _batch_size_cb(void *data, Efl_Ui_Position_Manager_Size_Call_Config conf, Eina_R
1013 sizes = memory.mem; 1013 sizes = memory.mem;
1014 //count = efl_model_children_count_get(parent); 1014 //count = efl_model_children_count_get(parent);
1015 limit = conf.range.end_id - conf.range.start_id; 1015 limit = conf.range.end_id - conf.range.start_id;
1016 ITEM_BASE_SIZE_FROM_MODEL(parent, item_base); 1016 if (!ITEM_BASE_SIZE_FROM_MODEL(parent, item_base)) return result;
1017 1017
1018 // Look in the temporary cache now for the beginning of the buffer 1018 // Look in the temporary cache now for the beginning of the buffer
1019#ifdef VIEWPORT_ENABLE 1019#ifdef VIEWPORT_ENABLE
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 96384d37e9..7a1a966e09 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -42,10 +42,6 @@ static Eio_Monitor *_eio_profile_monitor = NULL;
42 42
43Eina_Hash *_elm_key_bindings = NULL; 43Eina_Hash *_elm_key_bindings = NULL;
44 44
45#ifdef HAVE_ELEMENTARY_WL2
46Ecore_Wl2_Display *_elm_wl_display = NULL;
47#endif
48
49const char *_elm_engines[] = { 45const char *_elm_engines[] = {
50 "software_x11", 46 "software_x11",
51 "fb", 47 "fb",
@@ -4318,12 +4314,6 @@ _elm_config_sub_shutdown(void)
4318{ 4314{
4319 ecore_event_type_flush(ELM_EVENT_CONFIG_ALL_CHANGED); 4315 ecore_event_type_flush(ELM_EVENT_CONFIG_ALL_CHANGED);
4320 4316
4321#ifdef HAVE_ELEMENTARY_COCOA
4322 ecore_cocoa_shutdown();
4323#endif
4324#ifdef HAVE_ELEMENTARY_WIN32
4325 ecore_win32_shutdown();
4326#endif
4327 ELM_SAFE_FREE(_eio_config_monitor, eio_monitor_del); 4317 ELM_SAFE_FREE(_eio_config_monitor, eio_monitor_del);
4328 ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del); 4318 ELM_SAFE_FREE(_eio_profile_monitor, eio_monitor_del);
4329 ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del); 4319 ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del);
@@ -4414,12 +4404,6 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED,
4414void 4404void
4415_elm_config_sub_init(void) 4405_elm_config_sub_init(void)
4416{ 4406{
4417#ifdef HAVE_ELEMENTARY_COCOA
4418 ecore_cocoa_init();
4419#endif
4420#ifdef HAVE_ELEMENTARY_WIN32
4421 ecore_win32_init();
4422#endif
4423 char buf[PATH_MAX]; 4407 char buf[PATH_MAX];
4424 int ok = 0; 4408 int ok = 0;
4425 4409
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 146f2f8c53..fe7b65297d 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -904,10 +904,6 @@ extern Eina_Bool _config_profile_lock;
904 904
905extern Eina_FreeQ *postponed_fq; 905extern Eina_FreeQ *postponed_fq;
906 906
907# ifdef HAVE_ELEMENTARY_WL2
908extern Ecore_Wl2_Display *_elm_wl_display;
909# endif
910
911# ifdef ENABLE_NLS 907# ifdef ENABLE_NLS
912/* Our gettext wrapper, used to disable translation of elm if the app 908/* Our gettext wrapper, used to disable translation of elm if the app
913 * is not translated. */ 909 * is not translated. */
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 5182aefdbe..8a69da963f 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -21,6 +21,7 @@ static int (*_elput_sd_session_get_vt) (const char *session, unsigned *vtnr) = N
21static int (*_elput_sd_session_get_tty) (const char *session, char **display) = NULL; 21static int (*_elput_sd_session_get_tty) (const char *session, char **display) = NULL;
22static int (*_elput_sd_pid_get_session) (pid_t pid, char **session) = NULL; 22static int (*_elput_sd_pid_get_session) (pid_t pid, char **session) = NULL;
23static int (*_elput_sd_session_get_seat) (const char *session, char **seat) = NULL; 23static int (*_elput_sd_session_get_seat) (const char *session, char **seat) = NULL;
24static int (*_elput_sd_seat_can_tty) (const char *seat) = NULL;
24 25
25void 26void
26_elput_sd_init(void) 27_elput_sd_init(void)
@@ -91,14 +92,17 @@ _elput_sd_init(void)
91 eina_module_symbol_get(_libsystemd, "sd_pid_get_session"); 92 eina_module_symbol_get(_libsystemd, "sd_pid_get_session");
92 _elput_sd_session_get_seat = 93 _elput_sd_session_get_seat =
93 eina_module_symbol_get(_libsystemd, "sd_session_get_seat"); 94 eina_module_symbol_get(_libsystemd, "sd_session_get_seat");
95 _elput_sd_seat_can_tty =
96 eina_module_symbol_get(_libsystemd, "sd_seat_can_tty");
94 if (((!_elput_sd_session_get_vt) && (!_elput_sd_session_get_tty)) || 97 if (((!_elput_sd_session_get_vt) && (!_elput_sd_session_get_tty)) ||
95 (!_elput_sd_pid_get_session) || 98 (!_elput_sd_pid_get_session) ||
96 (!_elput_sd_session_get_seat)) 99 (!_elput_sd_session_get_seat) || (!_elput_sd_seat_can_tty))
97 { 100 {
98 _elput_sd_session_get_vt = NULL; 101 _elput_sd_session_get_vt = NULL;
99 _elput_sd_session_get_tty = NULL; 102 _elput_sd_session_get_tty = NULL;
100 _elput_sd_pid_get_session = NULL; 103 _elput_sd_pid_get_session = NULL;
101 _elput_sd_session_get_seat = NULL; 104 _elput_sd_session_get_seat = NULL;
105 _elput_sd_seat_can_tty = NULL;
102 eina_module_free(_libsystemd); 106 eina_module_free(_libsystemd);
103 _libsystemd = NULL; 107 _libsystemd = NULL;
104 _libsystemd_broken = EINA_TRUE; 108 _libsystemd_broken = EINA_TRUE;
@@ -631,7 +635,7 @@ _logind_connect(Elput_Manager **manager, const char *seat, unsigned int tty)
631 goto seat_err; 635 goto seat_err;
632 } 636 }
633 637
634 if ((seat) && (!strcmp(seat, "seat0"))) 638 if ((seat) && (_elput_sd_seat_can_tty(seat)))
635 { 639 {
636 if (!_logind_session_vt_get(em->sid, &em->vt_num)) 640 if (!_logind_session_vt_get(em->sid, &em->vt_num))
637 { 641 {
diff --git a/src/lib/evas/canvas/efl_canvas_vg_node.c b/src/lib/evas/canvas/efl_canvas_vg_node.c
index a076136815..f2bead512f 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_node.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_node.c
@@ -19,7 +19,15 @@ static const Efl_Canvas_Vg_Interpolation interpolation_identity = {
19static void 19static void
20_node_change(Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd) 20_node_change(Efl_VG *obj, Efl_Canvas_Vg_Node_Data *nd)
21{ 21{
22 if (!nd || nd->flags != EFL_GFX_CHANGE_FLAG_NONE) return; 22 if (!nd) return;
23 if (nd->flags != EFL_GFX_CHANGE_FLAG_NONE)
24 {
25 if ((nd->vd && nd->vd->obj) &&
26 (!nd->vd->obj || !nd->vd->obj->changed))
27 efl_canvas_vg_object_change(nd->vd);
28
29 return;
30 }
23 nd->flags = EFL_GFX_CHANGE_FLAG_ALL; 31 nd->flags = EFL_GFX_CHANGE_FLAG_ALL;
24 32
25 Eo *p = obj; 33 Eo *p = obj;
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 5d1c476466..501e12ba78 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -11055,6 +11055,9 @@ _evas_textblock_node_text_adjust_offsets_to_start(Efl_Canvas_Textblock_Data *o,
11055 size_t pos = 0; 11055 size_t pos = 0;
11056 int orig_end; 11056 int orig_end;
11057 11057
11058 if ((start == 0) && (end == 0))
11059 return EINA_FALSE;
11060
11058 itr = n->format_node; 11061 itr = n->format_node;
11059 if (!itr || (itr->text_node != n)) return EINA_FALSE; 11062 if (!itr || (itr->text_node != n)) return EINA_FALSE;
11060 11063
diff --git a/src/modules/ethumb/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index ccad1c9074..0a8447f49b 100644
--- a/src/modules/ethumb/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -319,8 +319,9 @@ _frame_grab(void *data)
319 319
320 pixels = ecore_evas_buffer_pixels_get(ee); 320 pixels = ecore_evas_buffer_pixels_get(ee);
321 snprintf(buf, sizeof(buf), "images/%d", _plugin->frnum); 321 snprintf(buf, sizeof(buf), "images/%d", _plugin->frnum);
322 eet_data_image_write(_plugin->ef, buf, pixels, _plugin->w, _plugin->h, 322 if (!eet_data_image_write(_plugin->ef, buf, pixels, _plugin->w, _plugin->h,
323 0, compress, quality, quality); 323 0, compress, quality, quality))
324 return EINA_TRUE;
324 _plugin->frnum++; 325 _plugin->frnum++;
325 } 326 }
326 327
diff --git a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
index 5dcf31039b..58cd961acf 100644
--- a/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
+++ b/src/modules/evas/image_loaders/psd/evas_image_load_psd.c
@@ -61,7 +61,7 @@ static Eina_Bool get_compressed_channels_length(PSD_Header *Head,
61static int 61static int
62read_ushort(const unsigned char *map, size_t length, size_t *position, unsigned short *ret) 62read_ushort(const unsigned char *map, size_t length, size_t *position, unsigned short *ret)
63{ 63{
64 if (*position + 2 > length) return 0; 64 if (((*position) + 2) > length) return 0;
65 // FIXME: need to check order 65 // FIXME: need to check order
66 *ret = (map[(*position) + 0] << 8) | map[(*position) + 1]; 66 *ret = (map[(*position) + 0] << 8) | map[(*position) + 1];
67 *position += 2; 67 *position += 2;
@@ -71,7 +71,7 @@ read_ushort(const unsigned char *map, size_t length, size_t *position, unsigned
71static int 71static int
72read_uint(const unsigned char *map, size_t length, size_t *position, unsigned int *ret) 72read_uint(const unsigned char *map, size_t length, size_t *position, unsigned int *ret)
73{ 73{
74 if (*position + 4 > length) return 0; 74 if (((*position) + 4) > length) return 0;
75 // FIXME: need to check order 75 // FIXME: need to check order
76 *ret = ARGB_JOIN(map[(*position) + 0], map[(*position) + 1], map[(*position) + 2], map[(*position) + 3]); 76 *ret = ARGB_JOIN(map[(*position) + 0], map[(*position) + 1], map[(*position) + 2], map[(*position) + 3]);
77 *position += 4; 77 *position += 4;
@@ -81,14 +81,14 @@ read_uint(const unsigned char *map, size_t length, size_t *position, unsigned in
81static int 81static int
82read_block(const unsigned char *map, size_t length, size_t *position, void *target, size_t size) 82read_block(const unsigned char *map, size_t length, size_t *position, void *target, size_t size)
83{ 83{
84 if (*position + size > length) return 0; 84 if (((*position) + size) > length) return 0;
85 memcpy(target, map + *position, size); 85 memcpy(target, map + *position, size);
86 *position += size; 86 *position += size;
87 return 1; 87 return 1;
88} 88}
89 89
90// Internal function used to get the Psd header from the current file. 90// Internal function used to get the Psd header from the current file.
91Eina_Bool 91static Eina_Bool
92psd_get_header(PSD_Header *header, const unsigned char *map, size_t length, size_t *position) 92psd_get_header(PSD_Header *header, const unsigned char *map, size_t length, size_t *position)
93{ 93{
94 unsigned short tmp; 94 unsigned short tmp;
@@ -114,7 +114,7 @@ psd_get_header(PSD_Header *header, const unsigned char *map, size_t length, size
114 114
115 115
116// Internal function used to check if the HEADER is a valid Psd header. 116// Internal function used to check if the HEADER is a valid Psd header.
117Eina_Bool 117static Eina_Bool
118is_psd(PSD_Header *header) 118is_psd(PSD_Header *header)
119{ 119{
120 if (strncmp((char*)header->signature, "8BPS", 4)) 120 if (strncmp((char*)header->signature, "8BPS", 4))
@@ -238,7 +238,7 @@ read_compressed_channel(const unsigned char *map, size_t length, size_t *positio
238} 238}
239 239
240 240
241Eina_Bool 241static Eina_Bool
242psd_get_data(PSD_Header *head, 242psd_get_data(PSD_Header *head,
243 const unsigned char *map, size_t length, size_t *position, 243 const unsigned char *map, size_t length, size_t *position,
244 unsigned char *buffer, Eina_Bool compressed, 244 unsigned char *buffer, Eina_Bool compressed,
@@ -492,7 +492,7 @@ psd_get_data(PSD_Header *head,
492} 492}
493 493
494 494
495Eina_Bool 495static Eina_Bool
496get_single_channel(PSD_Header *head, 496get_single_channel(PSD_Header *head,
497 const unsigned char *map, size_t length, size_t *position, 497 const unsigned char *map, size_t length, size_t *position,
498 unsigned char *buffer, 498 unsigned char *buffer,
@@ -552,7 +552,7 @@ get_single_channel(PSD_Header *head,
552 return EINA_TRUE; 552 return EINA_TRUE;
553} 553}
554 554
555Eina_Bool 555static Eina_Bool
556read_psd_grey(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) 556read_psd_grey(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error)
557{ 557{
558 unsigned int color_mode, resource_size, misc_info; 558 unsigned int color_mode, resource_size, misc_info;
@@ -566,15 +566,19 @@ read_psd_grey(void *pixels, PSD_Header *head, const unsigned char *map, size_t l
566 CHECK_RET(read_uint(map, length, position, &color_mode)); 566 CHECK_RET(read_uint(map, length, position, &color_mode));
567 // Skip over the 'color mode data section' 567 // Skip over the 'color mode data section'
568 *position += color_mode; 568 *position += color_mode;
569 if ((*position) >= length) return EINA_FALSE;
569 570
570 CHECK_RET(read_uint(map, length, position, &resource_size)); 571 CHECK_RET(read_uint(map, length, position, &resource_size));
571 // Read the 'image resources section' 572 // Read the 'image resources section'
572 *position += resource_size; 573 *position += resource_size;
574 if ((*position) >= length) return EINA_FALSE;
573 575
574 CHECK_RET(read_uint(map, length, position, &misc_info)); 576 CHECK_RET(read_uint(map, length, position, &misc_info));
575 *position += misc_info; 577 *position += misc_info;
578 if ((*position) >= length) return EINA_FALSE;
576 579
577 CHECK_RET(read_ushort(map, length, position, &compressed)); 580 CHECK_RET(read_ushort(map, length, position, &compressed));
581 if (compressed != 0) compressed = EINA_TRUE;
578 582
579 head->channel_num = head->channels; 583 head->channel_num = head->channels;
580 // Temporary to read only one channel...some greyscale .psd files have 2. 584 // Temporary to read only one channel...some greyscale .psd files have 2.
@@ -602,7 +606,7 @@ read_psd_grey(void *pixels, PSD_Header *head, const unsigned char *map, size_t l
602} 606}
603 607
604 608
605Eina_Bool 609static Eina_Bool
606read_psd_indexed(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) 610read_psd_indexed(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error)
607{ 611{
608 unsigned int color_mode, resource_size, misc_info; 612 unsigned int color_mode, resource_size, misc_info;
@@ -624,15 +628,19 @@ read_psd_indexed(void *pixels, PSD_Header *head, const unsigned char *map, size_
624 */ 628 */
625 // Skip over the 'color mode data section' 629 // Skip over the 'color mode data section'
626 *position += color_mode; 630 *position += color_mode;
631 if ((*position) >= length) return EINA_FALSE;
627 632
628 // Read the 'image resources section' 633 // Read the 'image resources section'
629 CHECK_RET(read_uint(map, length, position, &resource_size)); 634 CHECK_RET(read_uint(map, length, position, &resource_size));
630 *position += resource_size; 635 *position += resource_size;
636 if ((*position) >= length) return EINA_FALSE;
631 637
632 CHECK_RET(read_uint(map, length, position, &misc_info)); 638 CHECK_RET(read_uint(map, length, position, &misc_info));
633 *position += misc_info; 639 *position += misc_info;
640 if ((*position) >= length) return EINA_FALSE;
634 641
635 CHECK_RET(read_ushort(map, length, position, &compressed)); 642 CHECK_RET(read_ushort(map, length, position, &compressed));
643 if (compressed != 0) compressed = EINA_TRUE;
636 644
637 if (head->channels != 1 || head->depth != 8) 645 if (head->channels != 1 || head->depth != 8)
638 { 646 {
@@ -648,7 +656,7 @@ read_psd_indexed(void *pixels, PSD_Header *head, const unsigned char *map, size_
648#undef CHECK_RET 656#undef CHECK_RET
649} 657}
650 658
651Eina_Bool 659static Eina_Bool
652read_psd_rgb(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) 660read_psd_rgb(void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error)
653{ 661{
654 unsigned int color_mode, resource_size, misc_info; 662 unsigned int color_mode, resource_size, misc_info;
@@ -660,15 +668,19 @@ read_psd_rgb(void *pixels, PSD_Header *head, const unsigned char *map, size_t le
660 CHECK_RET(read_uint(map, length, position, &color_mode)); 668 CHECK_RET(read_uint(map, length, position, &color_mode));
661 // Skip over the 'color mode data section' 669 // Skip over the 'color mode data section'
662 *position += color_mode; 670 *position += color_mode;
671 if ((*position) >= length) return EINA_FALSE;
663 672
664 // Read the 'image resources section' 673 // Read the 'image resources section'
665 CHECK_RET(read_uint(map, length, position, &resource_size)); 674 CHECK_RET(read_uint(map, length, position, &resource_size));
666 *position += resource_size; 675 *position += resource_size;
676 if ((*position) >= length) return EINA_FALSE;
667 677
668 CHECK_RET(read_uint(map, length, position, &misc_info)); 678 CHECK_RET(read_uint(map, length, position, &misc_info));
669 *position += misc_info; 679 *position += misc_info;
680 if ((*position) >= length) return EINA_FALSE;
670 681
671 CHECK_RET(read_ushort(map, length, position, &compressed)); 682 CHECK_RET(read_ushort(map, length, position, &compressed));
683 if (compressed != 0) compressed = EINA_TRUE;
672 684
673 head->channel_num = head->channels; 685 head->channel_num = head->channels;
674 686
@@ -690,7 +702,7 @@ read_psd_rgb(void *pixels, PSD_Header *head, const unsigned char *map, size_t le
690#undef CHECK_RET 702#undef CHECK_RET
691} 703}
692 704
693Eina_Bool 705static Eina_Bool
694read_psd_cmyk(Emile_Image_Property *prop, void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error) 706read_psd_cmyk(Emile_Image_Property *prop, void *pixels, PSD_Header *head, const unsigned char *map, size_t length, size_t *position, int *error)
695{ 707{
696 unsigned int color_mode, resource_size, misc_info, size, j, data_size; 708 unsigned int color_mode, resource_size, misc_info, size, j, data_size;
@@ -707,15 +719,19 @@ read_psd_cmyk(Emile_Image_Property *prop, void *pixels, PSD_Header *head, const
707 CHECK_RET(read_uint(map, length, position, &color_mode)); 719 CHECK_RET(read_uint(map, length, position, &color_mode));
708 // Skip over the 'color mode data section' 720 // Skip over the 'color mode data section'
709 *position += color_mode; 721 *position += color_mode;
722 if ((*position) >= length) return EINA_FALSE;
710 723
711 CHECK_RET(read_uint(map, length, position, &resource_size)); 724 CHECK_RET(read_uint(map, length, position, &resource_size));
712 // Read the 'image resources section' 725 // Read the 'image resources section'
713 *position += resource_size; 726 *position += resource_size;
727 if ((*position) >= length) return EINA_FALSE;
714 728
715 CHECK_RET(read_uint(map, length, position, &misc_info)); 729 CHECK_RET(read_uint(map, length, position, &misc_info));
716 *position += misc_info; 730 *position += misc_info;
731 if ((*position) >= length) return EINA_FALSE;
717 732
718 CHECK_RET(read_ushort(map, length, position, &compressed)); 733 CHECK_RET(read_ushort(map, length, position, &compressed));
734 if (compressed != 0) compressed = EINA_TRUE;
719 735
720 switch (head->channels) 736 switch (head->channels)
721 { 737 {
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index f40bfa4915..246e3e2a0e 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -259,8 +259,6 @@ static struct {
259 259
260_PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDING); 260_PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDING);
261 261
262#if 0
263// unused at the moment
264/* parse the dash pattern used during stroking a path. 262/* parse the dash pattern used during stroking a path.
265 * Value: none | <dasharray> | inherit 263 * Value: none | <dasharray> | inherit
266 * Initial: none 264 * Initial: none
@@ -269,7 +267,8 @@ _PARSE_TAG(Efl_Gfx_Fill_Rule, fill_rule, fill_rule_tags, EFL_GFX_FILL_RULE_WINDI
269static inline void 267static inline void
270_parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length) 268_parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length)
271{ 269{
272 double tmp[30]; 270 // It is assumed that the length of the dasharray string is 255 or less.
271 double tmp[255];
273 char *end = NULL; 272 char *end = NULL;
274 int leni, gapi, count = 0, index = 0; 273 int leni, gapi, count = 0, index = 0;
275 274
@@ -291,20 +290,21 @@ _parse_dash_array(const char *str, Efl_Gfx_Dash** dash, int *length)
291 gapi = (2 * index + 1) % count; 290 gapi = (2 * index + 1) % count;
292 (*dash)[index].length = tmp[leni]; 291 (*dash)[index].length = tmp[leni];
293 (*dash)[index].gap = tmp[gapi]; 292 (*dash)[index].gap = tmp[gapi];
293 index++;
294 } 294 }
295 } 295 }
296 else 296 else
297 { // even case 297 { // even case
298 *length = count/2; 298 *length = count/2;
299 *dash = calloc(*length, sizeof(Efl_Gfx_Dash)); 299 *dash = calloc(*length, sizeof(Efl_Gfx_Dash));
300 while (index < count) 300 while (index < *length)
301 { 301 {
302 (*dash)[index].length = tmp[2 * index]; 302 (*dash)[index].length = tmp[2 * index];
303 (*dash)[index].gap = tmp[2 * index + 1]; 303 (*dash)[index].gap = tmp[2 * index + 1];
304 index++;
304 } 305 }
305 } 306 }
306} 307}
307#endif
308 308
309static Eina_Stringshare * 309static Eina_Stringshare *
310 _id_from_url(const char *url) 310 _id_from_url(const char *url)
@@ -865,6 +865,13 @@ _handle_stroke_opacity_attr(Evas_SVG_Loader *loader EINA_UNUSED, Svg_Node* node,
865} 865}
866 866
867static void 867static void
868_handle_stroke_dasharray_attr(Evas_SVG_Loader *loader EINA_UNUSED, Svg_Node* node, const char *value)
869{
870 node->style->stroke.flags |= SVG_STROKE_FLAGS_DASH;
871 _parse_dash_array(value, &node->style->stroke.dash, &node->style->stroke.dash_count);
872}
873
874static void
868_handle_stroke_width_attr(Evas_SVG_Loader *loader, Svg_Node* node, const char *value) 875_handle_stroke_width_attr(Evas_SVG_Loader *loader, Svg_Node* node, const char *value)
869{ 876{
870 node->style->stroke.flags |= SVG_STROKE_FLAGS_WIDTH; 877 node->style->stroke.flags |= SVG_STROKE_FLAGS_WIDTH;
@@ -942,6 +949,7 @@ static const struct {
942 STYLE_DEF(stroke-linejoin, stroke_linejoin), 949 STYLE_DEF(stroke-linejoin, stroke_linejoin),
943 STYLE_DEF(stroke-linecap, stroke_linecap), 950 STYLE_DEF(stroke-linecap, stroke_linecap),
944 STYLE_DEF(stroke-opacity, stroke_opacity), 951 STYLE_DEF(stroke-opacity, stroke_opacity),
952 STYLE_DEF(stroke-dasharray, stroke_dasharray),
945 STYLE_DEF(transform, transform), 953 STYLE_DEF(transform, transform),
946 STYLE_DEF(display, display) 954 STYLE_DEF(display, display)
947}; 955};
@@ -2367,6 +2375,22 @@ _inherit_style(Svg_Style_Property *child, Svg_Style_Property *parent)
2367 { 2375 {
2368 child->stroke.join = parent->stroke.join; 2376 child->stroke.join = parent->stroke.join;
2369 } 2377 }
2378 if (!(child->stroke.flags & SVG_STROKE_FLAGS_DASH))
2379 {
2380 int i = 0;
2381 int count = parent->stroke.dash_count;
2382 if (count > 0)
2383 {
2384 if (child->stroke.dash) free(child->stroke.dash);
2385 child->stroke.dash = calloc(count, sizeof(Efl_Gfx_Dash));
2386 child->stroke.dash_count = count;
2387 for (i = 0; i < count; i++)
2388 {
2389 child->stroke.dash[i].length = parent->stroke.dash[i].length;
2390 child->stroke.dash[i].gap = parent->stroke.dash[i].gap;
2391 }
2392 }
2393 }
2370} 2394}
2371 2395
2372void 2396void
diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c
index f5b71c43d2..38e203b205 100644
--- a/src/static_libs/vg_common/vg_common_svg.c
+++ b/src/static_libs/vg_common/vg_common_svg.c
@@ -498,6 +498,7 @@ _node_style_free(Svg_Style_Property *style)
498 eina_stringshare_del(style->fill.paint.url); 498 eina_stringshare_del(style->fill.paint.url);
499 _svg_style_gradient_free(style->stroke.paint.gradient); 499 _svg_style_gradient_free(style->stroke.paint.gradient);
500 eina_stringshare_del(style->stroke.paint.url); 500 eina_stringshare_del(style->stroke.paint.url);
501 if (style->stroke.dash) free(style->stroke.dash);
501 free(style); 502 free(style);
502} 503}
503 504
@@ -770,6 +771,8 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_
770 efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap); 771 efl_gfx_shape_stroke_cap_set(vg, style->stroke.cap);
771 efl_gfx_shape_stroke_join_set(vg, style->stroke.join); 772 efl_gfx_shape_stroke_join_set(vg, style->stroke.join);
772 efl_gfx_shape_stroke_scale_set(vg, style->stroke.scale); 773 efl_gfx_shape_stroke_scale_set(vg, style->stroke.scale);
774 if (style->stroke.dash && style->stroke.dash_count > 0)
775 efl_gfx_shape_stroke_dash_set(vg, style->stroke.dash, style->stroke.dash_count);
773 776
774 // if stroke property is NULL then do nothing 777 // if stroke property is NULL then do nothing
775 if (style->stroke.paint.none) 778 if (style->stroke.paint.none)
diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c
index 5df40b19ec..85ada68a49 100644
--- a/src/tests/elementary/elm_test_entry.c
+++ b/src/tests/elementary/elm_test_entry.c
@@ -653,6 +653,28 @@ EFL_START_TEST(elm_entry_keycode)
653} 653}
654EFL_END_TEST 654EFL_END_TEST
655 655
656EFL_START_TEST(elm_entry_textnodes_with_no_format)
657{
658 Evas_Object *win, *entry;
659
660 win = win_add(NULL, "entry", ELM_WIN_BASIC);
661 entry = elm_entry_add(win);
662 evas_object_show(entry);
663
664 elm_entry_entry_set(entry, "<br/><br/>");
665 Evas_Object *tb = elm_entry_textblock_get(entry);
666 Evas_Textblock_Cursor *c1 = evas_object_textblock_cursor_new(tb);
667 Evas_Textblock_Cursor *c2 = evas_object_textblock_cursor_new(tb);
668 evas_textblock_cursor_char_next(c2);
669 evas_textblock_cursor_range_delete(c1, c2);
670 elm_entry_cursor_pos_set(entry, 0);
671 ck_assert(elm_entry_cursor_down(entry));
672
673 evas_object_del(entry);
674 evas_object_del(win);
675}
676EFL_END_TEST
677
656void elm_test_entry(TCase *tc) 678void elm_test_entry(TCase *tc)
657{ 679{
658 tcase_add_test(tc, elm_entry_legacy_type_check); 680 tcase_add_test(tc, elm_entry_legacy_type_check);
@@ -674,4 +696,5 @@ void elm_test_entry(TCase *tc)
674 tcase_add_test(tc, elm_entry_test_text_class); 696 tcase_add_test(tc, elm_entry_test_text_class);
675 tcase_add_test(tc, elm_entry_test_burmese); 697 tcase_add_test(tc, elm_entry_test_burmese);
676 tcase_add_test(tc, elm_entry_keycode); 698 tcase_add_test(tc, elm_entry_keycode);
699 tcase_add_test(tc, elm_entry_textnodes_with_no_format);
677} 700}
diff --git a/src/tests/evas/evas_test_image.c b/src/tests/evas/evas_test_image.c
index 8106a0869e..4ec5aa919e 100644
--- a/src/tests/evas/evas_test_image.c
+++ b/src/tests/evas/evas_test_image.c
@@ -643,8 +643,18 @@ _file_to_memory(const char *filename, char **result)
643 643
644 fseek(f, 0, SEEK_END); 644 fseek(f, 0, SEEK_END);
645 size = ftell(f); 645 size = ftell(f);
646 if (size <= 0)
647 {
648 fclose(f);
649 return -1;
650 }
646 fseek(f, 0, SEEK_SET); 651 fseek(f, 0, SEEK_SET);
647 *result = (char *)malloc(size + 1); 652 *result = (char *)malloc(size + 1);
653 if (*result == NULL)
654 {
655 fclose(f);
656 return -1;
657 }
648 if ((size_t)size != fread(*result, sizeof(char), size, f)) 658 if ((size_t)size != fread(*result, sizeof(char), size, f))
649 { 659 {
650 free(*result); 660 free(*result);