]> git.sesse.net Git - vlc/commitdiff
iomx-dr: fix crash if anwpriv.connect fails
authorThomas Guillem <tom@gllm.fr>
Fri, 24 Oct 2014 15:41:14 +0000 (17:41 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 25 Oct 2014 01:25:11 +0000 (03:25 +0200)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/omxil.c

index 8512dc492f7188719ded81c9d8c9c490ffe57256..01605219ac450e3e9f86d15d9073e02ad03ae401 100644 (file)
@@ -2106,7 +2106,12 @@ static void HwBuffer_Init( decoder_t *p_dec, OmxPort *p_port )
         msg_Warn( p_dec, "winFromSurface failed" );
         goto error;
     }
-    p_port->p_hwbuf->anwpriv.connect( p_port->p_hwbuf->window );
+    if( p_port->p_hwbuf->anwpriv.connect( p_port->p_hwbuf->window ) != 0 ) {
+        msg_Warn( p_dec, "connect failed" );
+        p_port->p_hwbuf->native_window.winRelease( p_port->p_hwbuf->window );
+        p_port->p_hwbuf->window = NULL;
+        goto error;
+    }
 
     omx_error = pf_enable_graphic_buffers( p_port->omx_handle,
                                            p_port->i_port_index, OMX_TRUE );