From ba2dee38fbd33adcb5405e0726f5baaa75128ccc Mon Sep 17 00:00:00 2001 From: Anton Kindestam Date: Thu, 25 Oct 2018 12:01:31 +0200 Subject: hwdec_drmprime_drm: Missing NULL-check on drm_atomic_context video_plane Since 810acf32d6cf0dfbad66c602689ef1218fc0a6e3 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. --- video/out/opengl/hwdec_drmprime_drm.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video/out') diff --git a/video/out/opengl/hwdec_drmprime_drm.c b/video/out/opengl/hwdec_drmprime_drm.c index d4543b0f47..c02c9eafb6 100644 --- a/video/out/opengl/hwdec_drmprime_drm.c +++ b/video/out/opengl/hwdec_drmprime_drm.c @@ -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 -- cgit v1.2.3