summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-10-14 12:14:26 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-10-14 12:16:03 +0100
commit4192137ba9853c798e830acaa68c46f1afff0505 (patch)
tree7d426dadbbe75ea7d5b94ab2815b03b2ccead019 /src/lib/eet
parent68c824e3e9d3dd53a996424e279a8dd74bc1583d (diff)
eet - fix loading eet files that do not have dicts
my performance fix for locking around the eet dict breaks if there is no dict in the eet file. this causes a segv. fixes T8368 @fix
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_data.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/eet/eet_data.c b/src/lib/eet/eet_data.c
index f8293ed896..5bcf65f9d6 100644
--- a/src/lib/eet/eet_data.c
+++ b/src/lib/eet/eet_data.c
@@ -2283,11 +2283,11 @@ eet_data_read_cipher(Eet_File *ef,
2283 return NULL; 2283 return NULL;
2284 } 2284 }
2285 2285
2286 eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock 2286 if (ed) eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock
2287 eet_free_context_init(&context); 2287 eet_free_context_init(&context);
2288 data_dec = _eet_data_descriptor_decode(&context, ed, edd, data, size, NULL, 0); 2288 data_dec = _eet_data_descriptor_decode(&context, ed, edd, data, size, NULL, 0);
2289 eet_free_context_shutdown(&context); 2289 eet_free_context_shutdown(&context);
2290 eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock 2290 if (ed) eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock
2291 2291
2292 if (required_free) 2292 if (required_free)
2293 free((void *)data); 2293 free((void *)data);
@@ -2324,11 +2324,11 @@ eet_data_read_cipher_buffer(Eet_File *ef,
2324 return NULL; 2324 return NULL;
2325 } 2325 }
2326 2326
2327 eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock 2327 if (ed) eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock
2328 eet_free_context_init(&context); 2328 eet_free_context_init(&context);
2329 data_dec = _eet_data_descriptor_decode(&context, ed, edd, data, size, buffer, buffer_size); 2329 data_dec = _eet_data_descriptor_decode(&context, ed, edd, data, size, buffer, buffer_size);
2330 eet_free_context_shutdown(&context); 2330 eet_free_context_shutdown(&context);
2331 eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock 2331 if (ed) eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock
2332 2332
2333 if (required_free) 2333 if (required_free)
2334 free((void *)data); 2334 free((void *)data);
@@ -2361,11 +2361,11 @@ eet_data_node_read_cipher(Eet_File *ef,
2361 return NULL; 2361 return NULL;
2362 } 2362 }
2363 2363
2364 eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock 2364 if (ed) eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock
2365 eet_free_context_init(&context); 2365 eet_free_context_init(&context);
2366 result = _eet_data_descriptor_decode(&context, ed, NULL, data, size, NULL, 0); 2366 result = _eet_data_descriptor_decode(&context, ed, NULL, data, size, NULL, 0);
2367 eet_free_context_shutdown(&context); 2367 eet_free_context_shutdown(&context);
2368 eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock 2368 if (ed) eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock
2369 2369
2370 if (required_free) 2370 if (required_free)
2371 free((void *)data); 2371 free((void *)data);
@@ -4839,11 +4839,11 @@ eet_data_dump_cipher(Eet_File *ef,
4839 return 0; 4839 return 0;
4840 } 4840 }
4841 4841
4842 eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock 4842 if (ed) eet_dictionary_lock_read(ed); // XXX: get manual eet_dictionary lock
4843 eet_free_context_init(&context); 4843 eet_free_context_init(&context);
4844 result = _eet_data_descriptor_decode(&context, ed, NULL, data, size, NULL, 0); 4844 result = _eet_data_descriptor_decode(&context, ed, NULL, data, size, NULL, 0);
4845 eet_free_context_shutdown(&context); 4845 eet_free_context_shutdown(&context);
4846 eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock 4846 if (ed) eet_dictionary_unlock(ed); // XXX: release manual eet_dictionary lock
4847 4847
4848 eet_node_dump(result, 0, dumpfunc, dumpdata); 4848 eet_node_dump(result, 0, dumpfunc, dumpdata);
4849 4849