RaspiStill: Fix regression in d35be767 - uninitialised variable
authorDave Stevenson <6by9@users.noreply.github.com>
Sat, 25 Feb 2017 13:02:26 +0000 (13:02 +0000)
committerPhil Elwell <pelwell@users.noreply.github.com>
Sat, 25 Feb 2017 13:11:41 +0000 (13:11 +0000)
d35be767 relied on state->width/height being zero before setting
up the defaults, but the state structure is just on the stack
in main() and not initialised.
Initialise the whole structure to 0.

host_applications/linux/apps/raspicam/RaspiStill.c

index 521bd9a28e884682d203a9709f02430e661729d5..0c3cf3f311403d7fc5470a9d25268e45e2c54bd8 100644 (file)
@@ -58,7 +58,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #include <errno.h>
 #include <sysexits.h>
 
-#define VERSION_STRING "v1.3.10"
+#define VERSION_STRING "v1.3.11"
 
 #include "bcm_host.h"
 #include "interface/vcos/vcos.h"
@@ -1772,7 +1772,7 @@ static void rename_file(RASPISTILL_STATE *state, FILE *output_file,
 int main(int argc, const char **argv)
 {
    // Our main data storage vessel..
-   RASPISTILL_STATE state;
+   RASPISTILL_STATE state = {0};
    int exit_code = EX_OK;
 
    MMAL_STATUS_T status = MMAL_SUCCESS;