[vlc-commits] commit: MSW: fix assertion failure on Open() error paths (fix #3889) ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Mon Jul 19 19:34:38 CEST 2010


vlc/vlc-1.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 19 20:32:55 2010 +0300| [0b706f50610e485e0ddb62f9aaf5e4cd50ff0681] | committer: Rémi Denis-Courmont 

MSW: fix assertion failure on Open() error paths (fix #3889)

Do not try to delete a callback and/or a mutex that do not exist.
The goto error paths still look a bit suspicious, someone should
double check them.
(cherry picked from commit 1f253df8acc7f2c249c1aae2ba44cae2020a45f7)

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

 modules/video_output/msw/direct3d.c |    5 ++++-
 modules/video_output/msw/directx.c  |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index ac7e581..17183c0 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -181,7 +181,10 @@ static int Open(vlc_object_t *object)
 
     return VLC_SUCCESS;
 error:
-    Close(VLC_OBJECT(vd));
+    Direct3DClose(vd);
+    CommonClean(vd);
+    Direct3DDestroy(vd);
+    free(vd->sys);
     return VLC_EGENERIC;
 }
 
diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index 6b0a6df..73feb9b 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -235,7 +235,11 @@ static int Open(vlc_object_t *object)
     return VLC_SUCCESS;
 
 error:
-    Close(VLC_OBJECT(vd));
+    DirectXClose(vd);
+    CommonClean(vd);
+    if (sys->hddraw_dll)
+        FreeLibrary(sys->hddraw_dll);
+    free(sys);
     return VLC_EGENERIC;
 }
 



More information about the vlc-commits mailing list