libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit f675653eefe612dae726104914a2da451ea77077
parent 774014cdbdf1e5565ff3ad16cb9e8c983ed06369
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 15 Oct 2017 20:41:16 +0200

do not try to seek on SHM if we do not use SHM, even if (bad) plugin requests it

Diffstat:
Msrc/main/extractor.c | 17+++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/main/extractor.c b/src/main/extractor.c @@ -360,7 +360,7 @@ in_process_proc (void *cls, * all plugins are in-process) * @param ds data to process * @param proc function to call for each meta data item found - * @param proc_cls cls argument to proc + * @param proc_cls cls argument to @a proc */ static void do_extract (struct EXTRACTOR_PluginList *plugins, @@ -387,7 +387,10 @@ do_extract (struct EXTRACTOR_PluginList *plugins, for (pos = plugins; NULL != pos; pos = pos->next) plugin_count++; if (NULL != shm) - ready = EXTRACTOR_IPC_shared_memory_set_ (shm, ds, 0, DEFAULT_SHM_SIZE); + ready = EXTRACTOR_IPC_shared_memory_set_ (shm, + ds, + 0, + DEFAULT_SHM_SIZE); else ready = 0; have_in_memory = 0; @@ -500,7 +503,8 @@ do_extract (struct EXTRACTOR_PluginList *plugins, } data_available = -1; if ( (1 == done) && - (-1 != min_seek) ) + (-1 != min_seek) && + (NULL != shm) ) { /* current position done, but seek requested */ done = 0; @@ -642,6 +646,7 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, } for (pos = plugins; NULL != pos; pos = pos->next) if ( (NULL == pos->channel) && + (NULL != shm) && (EXTRACTOR_OPTION_IN_PROCESS != pos->flags) ) { if (NULL == pos->shm) @@ -652,7 +657,11 @@ EXTRACTOR_extract (struct EXTRACTOR_PluginList *plugins, pos->channel = EXTRACTOR_IPC_channel_create_ (pos, shm); } - do_extract (plugins, shm, datasource, proc, proc_cls); + do_extract (plugins, + shm, + datasource, + proc, + proc_cls); EXTRACTOR_datasource_destroy_ (datasource); }