mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 12:32:29 +00:00
v4l2videoenc: Skip negotiation of profiles/level if no codec
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>
This commit is contained in:
parent
57eebe8b05
commit
7bbe4653a4
1 changed files with 4 additions and 0 deletions
|
@ -530,6 +530,9 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder)
|
|||
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) {
|
||||
|
@ -581,6 +584,7 @@ gst_v4l2_video_enc_negotiate (GstVideoEncoder * encoder)
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue