diff options
author | Ravi Kiran K N <ravi.kiran@samsung.com> | 2015-08-27 10:28:55 +0530 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-08-27 11:13:43 +0300 |
commit | cac239ab89db5c37b59f078c734b2f8e5298c389 (patch) | |
tree | 04bb21b94a24165f2f866879a8464a665f26840d | |
parent | dd1bd2beb33e3e430f9bc92df1f5cdd12b0e0bd9 (diff) |
smpte: Fix memory leak
In gst_smpte_collected(), check upfront if input formats are same
or not. This avoids allocation of in1 and in2 buffers and
subsequent memory leak when input formats do not match.
https://bugzilla.gnome.org/show_bug.cgi?id=754153
-rw-r--r-- | gst/smpte/gstsmpte.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c index 722f146a3..696a1b4cd 100644 --- a/gst/smpte/gstsmpte.c +++ b/gst/smpte/gstsmpte.c @@ -468,6 +468,9 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte) !gst_pad_has_current_caps (smpte->sinkpad2)) goto not_negotiated; + if (!gst_video_info_is_equal (&smpte->vinfo1, &smpte->vinfo2)) + goto input_formats_do_not_match; + if (smpte->send_stream_start) { gchar s_id[32]; @@ -506,9 +509,6 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte) gst_buffer_unmap (in2, &map); } - if (!gst_video_info_is_equal (&smpte->vinfo1, &smpte->vinfo2)) - goto input_formats_do_not_match; - if (smpte->position < smpte->end_position) { outbuf = gst_buffer_new_and_alloc (I420_SIZE (smpte->width, smpte->height)); |