[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:07 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jul 19 20:32:55 2010 +0300| [1f253df8acc7f2c249c1aae2ba44cae2020a45f7] | 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.

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

 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 c1c5956..14f2bc9 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -184,7 +184,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 020725a..014a0d0 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -236,7 +236,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