mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
v4l2videodec: Correctly free caps to avoid memory leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5379>
This commit is contained in:
parent
c5bd0faee3
commit
be9d9371b7
1 changed files with 2 additions and 3 deletions
|
@ -465,10 +465,8 @@ gst_v4l2_video_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
/* Prefer the acquired caps over anything suggested downstream, this ensure
|
/* Prefer the acquired caps over anything suggested downstream, this ensure
|
||||||
* that we preserves the bit depth, as we don't have any fancy fixation
|
* that we preserves the bit depth, as we don't have any fancy fixation
|
||||||
* process */
|
* process */
|
||||||
if (gst_caps_is_subset (acquired_caps, caps)) {
|
if (gst_caps_is_subset (acquired_caps, caps))
|
||||||
gst_caps_unref (acquired_caps);
|
|
||||||
goto use_acquired_caps;
|
goto use_acquired_caps;
|
||||||
}
|
|
||||||
|
|
||||||
/* Fixate pixel format */
|
/* Fixate pixel format */
|
||||||
caps = gst_caps_fixate (caps);
|
caps = gst_caps_fixate (caps);
|
||||||
|
@ -482,6 +480,7 @@ gst_v4l2_video_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
gst_v4l2_clear_error (&error);
|
gst_v4l2_clear_error (&error);
|
||||||
|
|
||||||
use_acquired_caps:
|
use_acquired_caps:
|
||||||
|
gst_caps_unref (acquired_caps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
|
|
||||||
/* catch possible bogus driver that don't enumerate the format it actually
|
/* catch possible bogus driver that don't enumerate the format it actually
|
||||||
|
|
Loading…
Reference in a new issue