It's possible to have 4:2:0 chroma format without chroma-site in caps, but it
isn't validated by the current code. This patch fixes it.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3405>
GstVideoChromaSite chroma_site;
chroma_site_str = gst_structure_get_string (caps_st, "chroma-site");
- chroma_site = gst_video_chroma_site_from_string (chroma_site_str);
+ if (chroma_site_str)
+ chroma_site = gst_video_chroma_site_from_string (chroma_site_str);
+ else
+ chroma_site = GST_VIDEO_CHROMA_SITE_UNKNOWN;
if (chroma_site == GST_VIDEO_CHROMA_SITE_V_COSITED) {
chroma_format = 0;
} else if (chroma_site == GST_VIDEO_CHROMA_SITE_COSITED) {