From 1200570a808b1b25db013e97f853a7416e9997ca Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 9 Apr 2024 18:47:34 +0200 Subject: [PATCH] add null check set option info flag --- src/kds_s2000w_handler_opts.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; -- 2.39.5