video: fix segmentation fault on video capture

If there was no picture capture or camera switch after application start, then
state_proc.configuration is uninitialized. If video capture is started
in this case, then segmentation fault happens.

Thread 8 "megapixels-pr" received signal SIGSEGV, Segmentation fault.
1085	        if (state_proc.configuration->make != NULL &&
(gdb) p state_proc.configuration
$1 = (libmegapixels_devconfig *) 0x0

state.configuration is set in update_state(), but set only after
init_controls(). After update_process_pipeline() is
called from init_controls() pipeline_change flag is reset and changes
after init_controls() (including state.configuration) are not applied to
state_proc. Removing update_process_pipeline from init_controls()
makes all settings to be applied at the end of update_state().
init_controls() is called only from update_state().
This commit is contained in:
Andrey Skvortsov
2025-03-29 19:57:38 +03:00
committed by Martijn Braam
parent 35b84f0a12
commit 883c16733d

View File

@@ -583,7 +583,6 @@ init_controls()
}
pipeline_changed = true;
update_process_pipeline();
}
/*