summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-11 17:04:30 +0200
committerwm4 <wm4@nowhere>2016-05-11 17:12:59 +0200
commitfe540f4477408705531d175df437f20e2d91d504 (patch)
tree2e7a0232cdebb7c525f75aba1a0eda18a543afee /video/out
parent70b35612704a992dac45856e069608216f41ea89 (diff)
downloadmpv-fe540f4477408705531d175df437f20e2d91d504.tar.bz2
mpv-fe540f4477408705531d175df437f20e2d91d504.tar.xz
vo_opengl: fix NULL deref on certain init failures
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_opengl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 306e893f3b..64d537bd5f 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -365,8 +365,10 @@ static void uninit(struct vo *vo)
gl_video_uninit(p->renderer);
gl_hwdec_uninit(p->hwdec);
- hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL);
- hwdec_devices_destroy(vo->hwdec_devs);
+ if (vo->hwdec_devs) {
+ hwdec_devices_set_loader(vo->hwdec_devs, NULL, NULL);
+ hwdec_devices_destroy(vo->hwdec_devs);
+ }
mpgl_uninit(p->glctx);
}