aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-08 18:43:04 +0100
committerThomas White <taw@physics.org>2019-03-14 11:36:56 +0100
commitde09b82310f7b464e4095d1b750d9b968c84b6ed (patch)
treeb41fbb70c87e4563680babf966fa89ff96097d00 /src
parent9e1b43f729bf8ba8a6945c5fac67a8796226e2a0 (diff)
Fix variable initialisation and decision about data source
Diffstat (limited to 'src')
-rw-r--r--src/im-sandbox.c3
-rw-r--r--src/process_image.c10
2 files changed, 7 insertions, 6 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index 9c00ad0c..20bd6c94 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -371,7 +371,7 @@ static int run_work(const struct index_args *iargs, Stream *st,
{
int allDone = 0;
TimeAccounts *taccs;
- struct im_zmq *zmqstuff;
+ struct im_zmq *zmqstuff = NULL;
/* Connect via ZMQ */
if ( sb->zmq ) {
@@ -453,6 +453,7 @@ static int run_work(const struct index_args *iargs, Stream *st,
} else {
pargs.msgpack_obj = im_zmq_fetch(zmqstuff);
+ pargs.filename_p_e = NULL;
}
diff --git a/src/process_image.c b/src/process_image.c
index afd43d3b..3dd02aaa 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -195,7 +195,7 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
int serial, struct sb_shm *sb_shared, TimeAccounts *taccs,
char *last_task)
{
- struct imagefile *imfile;
+ struct imagefile *imfile = NULL;
struct image image;
int i;
int r;
@@ -214,15 +214,15 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
image.serial = serial;
image.indexed_by = INDEXING_NONE;
- if ( pargs->filename_p_e != NULL ) {
+ if ( pargs->msgpack_obj != NULL ) {
+ STATUS("Msgpack!\n");
+ if ( unpack_msgpack_data(pargs->msgpack_obj, &image) ) return;
+ } else if ( pargs->filename_p_e != NULL ) {
image.filename = pargs->filename_p_e->filename;
image.event = pargs->filename_p_e->ev;
if ( file_wait_open_read(sb_shared, &image, taccs, last_task,
iargs->wait_for_file, cookie,
&imfile) ) return;
- } else if ( pargs->msgpack_obj != NULL ) {
- STATUS("Msgpack!\n");
- if ( unpack_msgpack_data(pargs->msgpack_obj, &image) ) return;
}
/* Take snapshot of image before applying horrible noise filters */