mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
v4l2: videodec: Ensure object is inactive on failure
Sprinkle stop() calls in error case to guaranty that the capture object is inactive on failure. Not doing so could allow some code to be called in unexpected (and possibly undefined) conditions. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4437>
This commit is contained in:
parent
8e64dea5c6
commit
1ca7f6949e
1 changed files with 3 additions and 0 deletions
|
@ -685,13 +685,16 @@ gst_v4l2_video_dec_setup_capture (GstVideoDecoder * decoder)
|
|||
not_negotiated:
|
||||
GST_ERROR_OBJECT (self, "not negotiated");
|
||||
gst_v4l2_error (self, &error);
|
||||
gst_v4l2_object_stop (self->v4l2capture);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
activate_failed:
|
||||
GST_ELEMENT_ERROR (self, RESOURCE, SETTINGS,
|
||||
(_("Failed to allocate required memory.")),
|
||||
("Buffer pool activation failed"));
|
||||
gst_v4l2_object_stop (self->v4l2capture);
|
||||
return GST_FLOW_ERROR;
|
||||
flushing:
|
||||
gst_v4l2_object_stop (self->v4l2capture);
|
||||
return GST_FLOW_FLUSHING;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue