vo_drm: fix segfault when using invalid card

This commit is contained in:
rr- 2016-10-06 20:01:31 +02:00 committed by wm4
parent e543853a7f
commit ea1b183f4c
1 changed files with 2 additions and 2 deletions

View File

@ -392,10 +392,10 @@ static void uninit(struct vo *vo)
struct priv *p = vo->priv;
crtc_release(vo);
for (unsigned int i = 0; i < BUF_COUNT; i++)
fb_destroy(p->kms->fd, &p->bufs[i]);
if (p->kms) {
for (unsigned int i = 0; i < BUF_COUNT; i++)
fb_destroy(p->kms->fd, &p->bufs[i]);
kms_destroy(p->kms);
p->kms = NULL;
}