From 70fe8d12fa6c4892274655672204b1d748727092 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 24 Apr 2012 00:41:12 +0200 Subject: win32: don't crash if vo_w32_uninit() is called without vo_w32_init() This is a recent regression. At least vo_direct3d uses vo_w32_uninit() in this way, and crashed if initialization failed at an early point. --- libvo/w32_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvo/w32_common.c b/libvo/w32_common.c index ad8d1f453b..ebe17bd154 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -742,6 +742,8 @@ void vo_w32_uninit(struct vo *vo) { struct vo_w32_state *w32 = vo->w32; mp_msg(MSGT_VO, MSGL_V, "vo: win32: uninit\n"); + if (!w32) + return; resetMode(vo); ShowCursor(1); if (w32->dev_hdc) DeleteDC(w32->dev_hdc); -- cgit v1.2.3