mirror of https://github.com/mpv-player/mpv
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:
parent
bdec4421e6
commit
ba2dee38fb
|
@ -114,6 +114,9 @@ static void disable_video_plane(struct ra_hwdec *hw)
|
||||||
if (!p->ctx)
|
if (!p->ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!p->ctx->video_plane)
|
||||||
|
return;
|
||||||
|
|
||||||
// Disabling video plane is needed on some devices when using the
|
// Disabling video plane is needed on some devices when using the
|
||||||
// primary plane for video. Primary buffer can't be active with no
|
// primary plane for video. Primary buffer can't be active with no
|
||||||
// framebuffer associated. So we need this function to commit it
|
// framebuffer associated. So we need this function to commit it
|
||||||
|
|
Loading…
Reference in New Issue