[vlc-commits] ml: don't crash if there's no sql provider

Francois Cartegnie git at videolan.org
Fri Aug 10 12:34:46 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Aug 10 12:33:59 2012 +0200| [b1b58e3876d318e471a0baa9453837374d502d24] | committer: Francois Cartegnie

ml: don't crash if there's no sql provider

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

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

diff --git a/modules/media_library/sql_media_library.c b/modules/media_library/sql_media_library.c
index 5d76181..7828f86 100644
--- a/modules/media_library/sql_media_library.c
+++ b/modules/media_library/sql_media_library.c
@@ -157,7 +157,12 @@ static int load( vlc_object_t *obj )
     vlc_mutex_init( &p_ml->p_sys->lock );
 
     /* Initialise Sql module */
-    InitDatabase( p_ml );
+    if ( InitDatabase( p_ml ) != VLC_SUCCESS )
+    {
+        vlc_mutex_destroy( &p_ml->p_sys->lock );
+        //free( p_ml->p_sys ); // FIXME: Freed in InitDatase ?!?
+        return VLC_EGENERIC;
+    }
 
     /* Initialise the media pool */
     ARRAY_INIT( p_ml->p_sys->mediapool );



More information about the vlc-commits mailing list