changeset 24943:1777d38d020d

Fix segmentation fault after audio initialization failure in tv driver. Error was caused by double call to driver's uninit() routine.
author voroshil
date Mon, 05 Nov 2007 16:33:29 +0000
parents efdd237bf968
children 975308353c33
files stream/tv.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stream/tv.c	Mon Nov 05 12:02:21 2007 +0000
+++ b/stream/tv.c	Mon Nov 05 16:33:29 2007 +0000
@@ -617,7 +617,10 @@
     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 @@
 {
     tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
     if (!tvh) return;
-    tvh->functions->uninit(tvh->priv);
+    tv_uninit(tvh);
     demuxer->priv=NULL;
 }