1
mirror of https://github.com/mpv-player/mpv synced 2024-09-12 23:45:53 +02:00

hwdec_drmprime_drm: Missing NULL-check on drm_atomic_context video_plane

Since 810acf32d6 video_plane can be NULL
under some circumstances. While there is a check in init, init treats
this as an error condition and would call uninit, which in turn calls
disable_video_plane, which would then segfault. Fix this by including
a NULL check inside disable_video_plane, so that it doesn't try to
disable what isnt' there.
This commit is contained in:
Anton Kindestam 2018-10-25 12:01:31 +02:00 committed by sfan5
parent bdec4421e6
commit ba2dee38fb

View File

@ -114,6 +114,9 @@ static void disable_video_plane(struct ra_hwdec *hw)
if (!p->ctx)
return;
if (!p->ctx->video_plane)
return;
// Disabling video plane is needed on some devices when using the
// primary plane for video. Primary buffer can't be active with no
// framebuffer associated. So we need this function to commit it