summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWooHyun Jung <wh0705.jung@samsung.com>2020-04-13 10:39:34 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-04-13 10:39:34 +0900
commitde943b82aabab0db8056152392502372e5587e6b (patch)
treeeee5e84047c8a5d06953ab61025617912c0b6115
parent7ef5b60411fac4b1ce30cf5b1e8f0cd3fe48e0ee (diff)
edje_calc: add null check after eet_read
-rw-r--r--src/lib/edje/edje_calc.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 1a88b23d0e..2af4934ce9 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3239,19 +3239,22 @@ _edje_vector_load_lottie(Edje *ed, Edje_Real_Part *ep, const char *key)
3239 if (ep->typedata.vector->current_id != desc->vg.id) 3239 if (ep->typedata.vector->current_id != desc->vg.id)
3240 { 3240 {
3241 lottie_data = (char *)eet_read(ed->file->ef, key, &lottie_data_len); 3241 lottie_data = (char *)eet_read(ed->file->ef, key, &lottie_data_len);
3242 lottie_data[lottie_data_len] = '\0'; 3242 if (lottie_data)
3243 file = eina_file_virtualize(NULL, lottie_data, lottie_data_len + 1, EINA_FALSE); 3243 {
3244 efl_file_simple_mmap_load(ep->object, file, NULL); 3244 lottie_data[lottie_data_len] = '\0';
3245 file = eina_file_virtualize(NULL, lottie_data, lottie_data_len + 1, EINA_FALSE);
3246 efl_file_simple_mmap_load(ep->object, file, NULL);
3245 3247
3246 if (ep->typedata.vector->lottie_virtual_file) 3248 if (ep->typedata.vector->lottie_virtual_file)
3247 eina_file_close(ep->typedata.vector->lottie_virtual_file); 3249 eina_file_close(ep->typedata.vector->lottie_virtual_file);
3248 ep->typedata.vector->lottie_virtual_file = file; 3250 ep->typedata.vector->lottie_virtual_file = file;
3249 3251
3250 if (ep->typedata.vector->lottie_data) 3252 if (ep->typedata.vector->lottie_data)
3251 free(ep->typedata.vector->lottie_data); 3253 free(ep->typedata.vector->lottie_data);
3252 ep->typedata.vector->lottie_data = lottie_data; 3254 ep->typedata.vector->lottie_data = lottie_data;
3253 3255
3254 ep->typedata.vector->current_id = desc->vg.id; 3256 ep->typedata.vector->current_id = desc->vg.id;
3257 }
3255 } 3258 }
3256 3259
3257 frame_duration = efl_gfx_frame_controller_frame_duration_get(ep->object, 0, 0); 3260 frame_duration = efl_gfx_frame_controller_frame_duration_get(ep->object, 0, 0);