aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
diff options
context:
space:
mode:
authorGravatar Anton Kindestam <antonki@kth.se>2018-10-25 12:01:31 +0200
committerGravatar sfan5 <sfan5@live.de>2018-10-25 13:50:09 +0200
commitba2dee38fbd33adcb5405e0726f5baaa75128ccc (patch)
tree80e6a21d8a2e15ea33ca045d43bc77372be79796 /video
parentbdec4421e69e62403a3bab3fdafd8b11ba0a070b (diff)
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.
Diffstat (limited to 'video')
-rw-r--r--video/out/opengl/hwdec_drmprime_drm.c3
1 files changed, 3 insertions, 0 deletions
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