mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
v4l2codecdec: Fix error handling
If none of the format the HW produce is supported, the fiter will be NULL, which would lead to assertion when trying to release it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1268>
This commit is contained in:
parent
26264163de
commit
661f0c161e
2 changed files with 10 additions and 0 deletions
|
@ -185,6 +185,11 @@ gst_v4l2_codec_h264_dec_negotiate (GstVideoDecoder * decoder)
|
|||
}
|
||||
|
||||
filter = gst_v4l2_decoder_enum_src_formats (self->decoder);
|
||||
if (!filter) {
|
||||
GST_ELEMENT_ERROR (self, CORE, NEGOTIATION,
|
||||
("No supported decoder output formats"), (NULL));
|
||||
return FALSE;
|
||||
}
|
||||
GST_DEBUG_OBJECT (self, "Supported output formats: %" GST_PTR_FORMAT, filter);
|
||||
|
||||
caps = gst_pad_peer_query_caps (decoder->srcpad, filter);
|
||||
|
|
|
@ -175,6 +175,11 @@ gst_v4l2_codec_vp8_dec_negotiate (GstVideoDecoder * decoder)
|
|||
}
|
||||
|
||||
filter = gst_v4l2_decoder_enum_src_formats (self->decoder);
|
||||
if (!filter) {
|
||||
GST_ELEMENT_ERROR (self, CORE, NEGOTIATION,
|
||||
("No supported decoder output formats"), (NULL));
|
||||
return FALSE;
|
||||
}
|
||||
GST_DEBUG_OBJECT (self, "Supported output formats: %" GST_PTR_FORMAT, filter);
|
||||
|
||||
caps = gst_pad_peer_query_caps (decoder->srcpad, filter);
|
||||
|
|
Loading…
Reference in a new issue