]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add null check set option info flag
authorBastian Dehn <hhaalo@arcor.de>
Tue, 9 Apr 2024 16:47:34 +0000 (18:47 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 9 Apr 2024 16:47:34 +0000 (18:47 +0200)
src/kds_s2000w_handler_opts.c

index 8ff8c26895b93413e604c3b8248919c4489c9975..44ea05fb2fb328a29fee2080d32112247f1f37da 100644 (file)
@@ -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;