mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
gst: pipewireformat: Validate fourcc before converting to string
gst_video_dma_drm_fourcc_to_string() asserts when called with DRM_FORMAT_INVALID.
This commit is contained in:
parent
80d44e8f39
commit
9debb4b814
1 changed files with 2 additions and 0 deletions
|
|
@ -881,6 +881,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)
|
if ((idx = find_index(video_format_map, SPA_N_ELEMENTS(video_format_map), id)) == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
fourcc = gst_video_dma_drm_fourcc_from_format(idx);
|
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);
|
return gst_video_dma_drm_fourcc_to_string(fourcc, mod);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue