[vlc-commits] iomx-dr: fix crash if anwpriv.connect fails

Thomas Guillem git at videolan.org
Sat Oct 25 03:25:18 CEST 2014


vlc | branch: master | Thomas Guillem <tom at gllm.fr> | Fri Oct 24 17:41:14 2014 +0200| [1ab2a942a26cd527b890977861bdcc2fdfcb7c72] | committer: Jean-Baptiste Kempf

iomx-dr: fix crash if anwpriv.connect fails

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1ab2a942a26cd527b890977861bdcc2fdfcb7c72
---

 modules/codec/omxil/omxil.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/modules/codec/omxil/omxil.c b/modules/codec/omxil/omxil.c
index 8512dc4..0160521 100644
--- a/modules/codec/omxil/omxil.c
+++ b/modules/codec/omxil/omxil.c
@@ -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 );



More information about the vlc-commits mailing list