From eeebe59b36297b98f7e6550e1a6edd322e714d60 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Mon, 12 Feb 2024 11:11:43 -0500 Subject: [PATCH] va: Re-add drm_state and fd checks to VA_DRM_GetDriverNames Apps like gstreamer will crash on WSL without this check, which existed before but was removed in commit f09781156b24c571c187250f6d0f5eeff042528b Signed-off-by: Sil Vilerino --- va/drm/va_drm_utils.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/va/drm/va_drm_utils.c b/va/drm/va_drm_utils.c index 290f2491a..e6a477fff 100644 --- a/va/drm/va_drm_utils.c +++ b/va/drm/va_drm_utils.c @@ -72,6 +72,9 @@ VA_DRM_GetDriverNames(VADriverContextP ctx, char **drivers, unsigned *num_driver char *drm_driver; unsigned count = 0; + if (!drm_state || drm_state->fd < 0) + return VA_STATUS_ERROR_INVALID_DISPLAY; + drm_driver = va_DRM_GetDrmDriverName(drm_state->fd); if (!drm_driver) return VA_STATUS_ERROR_UNKNOWN;