hwdec_drmprime_drm: fix segv with --hwdec

This commit is contained in:
Ryo Munakata 2017-10-29 00:33:50 +09:00 committed by wm4
parent 98986948e8
commit 046fe45950
1 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,10 @@ static void set_current_frame(struct ra_hwdec *hw, struct drm_frame *frame)
// We used old frame as triple buffering to make sure that the drm framebuffer
// is not being displayed when we release it.
drm_prime_destroy_framebuffer(p->log, p->ctx->fd, &p->old_frame.fb);
if (p->ctx) {
drm_prime_destroy_framebuffer(p->log, p->ctx->fd, &p->old_frame.fb);
}
mp_image_setrefp(&p->old_frame.image, p->current_frame.image);
p->old_frame.fb = p->current_frame.fb;