]> git.sesse.net Git - vlc/commitdiff
- control APIs: do not crash if exception parameter is null, that means caller is...
authorDamien Fouilleul <damienf@videolan.org>
Mon, 5 Mar 2007 00:09:53 +0000 (00:09 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Mon, 5 Mar 2007 00:09:53 +0000 (00:09 +0000)
src/control/core.c
src/control/video.c

index eba0c8c93f9591de95abf6d2374b6138c8c7f04b..3f7cc9aa19b3dc455c90f2972c6fa49bcb372527 100644 (file)
@@ -45,7 +45,7 @@ void libvlc_exception_clear( libvlc_exception_t *p_exception )
 
 inline int libvlc_exception_raised( libvlc_exception_t *p_exception )
 {
-    return p_exception->b_raised;
+    return (NULL != p_exception) && p_exception->b_raised;
 }
 
 inline char* libvlc_exception_get_message( libvlc_exception_t *p_exception )
index 8adac83d14eea020e17b81ad61699a9771c050e1..326fa301dc79499ebe3547359a0e8dc890883f1b 100644 (file)
@@ -197,9 +197,10 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
                                   libvlc_exception_t *p_e )
 {
     vout_thread_t *p_vout = GetVout( p_input, p_e );
-    if ( libvlc_exception_raised( p_e ) )
+    if ( NULL == p_vout )
     {
-        if ( strcmp( "No active video output", libvlc_exception_get_message( p_e ) ) == 0 )
+        if ( libvlc_exception_raised( p_e )
+         &&  strcmp( "No active video output", libvlc_exception_get_message( p_e ) ) == 0 )
         {
             libvlc_exception_clear( p_e );
         }