The codec structure is optional and not used for fwht test codec. This
was leading to a crash dereferencing NULL pointer.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/650>
if (self->input_state)
return TRUE;
+ if (!codec)
+ goto done;
+
allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder));
if (allowed_caps) {
if (codec->level_cid)
gst_structure_set (s, "level", G_TYPE_STRING, ctx.level, NULL);
+done:
if (!GST_VIDEO_ENCODER_CLASS (parent_class)->negotiate (encoder))
return FALSE;