From: Bastian Dehn Date: Tue, 9 Apr 2024 16:47:34 +0000 (+0200) Subject: add null check set option info flag X-Git-Tag: v1.0.0^2~26 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=1200570a808b1b25db013e97f853a7416e9997ca;p=sane-kds-s2000w-net.git add null check set option info flag --- diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index 8ff8c26..44ea05f 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -193,13 +193,15 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf h->current_metadata->format = 1; h->current_metadata->channels = 3; h->current_metadata->depth = 8; - *info = RELOAD_OPTIONS; + if (info != NULL) + *info = RELOAD_OPTIONS; } else { h->current_metadata->format = 0; h->current_metadata->channels = 1; } - *info |= RELOAD_PARAMS; + if (info != NULL) + *info |= RELOAD_PARAMS; break; case 4: @@ -309,7 +311,9 @@ void kds_s2000w_handler_set_option(handler* h, int option, void* value, int* inf h->current_metadata->channels = 3; h->current_metadata->depth = 8; - *info = RELOAD_OPTIONS | RELOAD_PARAMS; + if (info != NULL) + *info = RELOAD_OPTIONS | RELOAD_PARAMS; + _load_options(h); return; break;