[MPlayer-cvslog] r24971 - trunk/stream/tv.c

voroshil subversion at mplayerhq.hu
Mon Nov 5 17:33:29 CET 2007


Author: voroshil
Date: Mon Nov  5 17:33:29 2007
New Revision: 24971

Log:
Fix segmentation fault after audio initialization failure in tv driver.

Error was caused by double call to driver's uninit() routine.



Modified:
   trunk/stream/tv.c

Modified: trunk/stream/tv.c
==============================================================================
--- trunk/stream/tv.c	(original)
+++ trunk/stream/tv.c	Mon Nov  5 17:33:29 2007
@@ -617,7 +617,10 @@ static int tv_uninit(tvi_handle_t *tvh)
     if(!tvh) return 1;
     if (!tvh->priv) return 1;
     res=tvh->functions->uninit(tvh->priv);
-    if(res) tvh->priv=NULL;
+    if(res) {
+        free(tvh->priv);
+        tvh->priv=NULL;
+    }
     return res;
 }
 
@@ -784,7 +787,7 @@ static void demux_close_tv(demuxer_t *de
 {
     tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
     if (!tvh) return;
-    tvh->functions->uninit(tvh->priv);
+    tv_uninit(tvh);
     demuxer->priv=NULL;
 }
 



More information about the MPlayer-cvslog mailing list