From 866103462037be67f3dc4af0d1a9c02bc10a37df Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Sun, 6 Jul 2025 21:27:33 +0200 Subject: [PATCH] gst: pipewireformat: Validate fourcc before converting to string gst_video_dma_drm_fourcc_to_string() asserts when called with DRM_FORMAT_INVALID. (cherry picked from commit 9debb4b814f2901a35ad5013dbe90ba63625a74b) --- src/gst/gstpipewireformat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gst/gstpipewireformat.c b/src/gst/gstpipewireformat.c index 903d216e2..98d5296a3 100644 --- a/src/gst/gstpipewireformat.c +++ b/src/gst/gstpipewireformat.c @@ -828,6 +828,8 @@ static char *video_id_to_dma_drm_fourcc(uint32_t id, uint64_t mod) if ((idx = find_index(video_format_map, SPA_N_ELEMENTS(video_format_map), id)) == -1) return NULL; fourcc = gst_video_dma_drm_fourcc_from_format(idx); + if (fourcc == DRM_FORMAT_INVALID) + return NULL; return gst_video_dma_drm_fourcc_to_string(fourcc, mod); } #endif