tvservice: Avoid referencing uninitialised state when unsuccessful
authorpopcornmix <popcornmix@gmail.com>
Tue, 30 May 2017 14:59:10 +0000 (15:59 +0100)
committerpopcornmix <popcornmix@gmail.com>
Tue, 30 May 2017 14:59:10 +0000 (15:59 +0100)
interface/vmcs_host/vc_vchi_tvservice.c

index cf33e11dcc44a5baeaef31883dad312cd2253f05..b8337f38c816a0f31f329aa0af1a2b43c927ce17 100644 (file)
@@ -681,7 +681,9 @@ static void *tvservice_notify_func(void *arg) {
 
    vcos_log_trace("TV service async thread started");
    /* Check starting state, and put service in use if necessary */
-   tvservice_send_command_reply( VC_TV_GET_DISPLAY_STATE, NULL, 0, &tvstate, sizeof(TV_DISPLAY_STATE_T));
+   success = tvservice_send_command_reply( VC_TV_GET_DISPLAY_STATE, NULL, 0, &tvstate, sizeof(TV_DISPLAY_STATE_T));
+   if (success != 0)
+      return 0;
    if (tvstate.state & VC_HDMI_ATTACHED)
    {
       /* Connected */