diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-04-20 19:43:53 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-08-24 23:42:27 +0100 |
commit | 90c1732849c0233dd428d578ebbc481c23a36f4d (patch) | |
tree | 5b4f0b8df083338f11c5f515f333e00c98f26910 /ext | |
parent | 42a7edd40fa606eeb82a213168fff2d6d151a78c (diff) | |
download | gstreamer-plugins-bad-90c1732849c0233dd428d578ebbc481c23a36f4d.tar.gz |
openh264enc: fix caps and header buffer leak
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2178>
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openh264/gstopenh264enc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp index 103794197..502eca92c 100644 --- a/ext/openh264/gstopenh264enc.cpp +++ b/ext/openh264/gstopenh264enc.cpp @@ -811,6 +811,8 @@ gst_openh264enc_set_format (GstVideoEncoder * encoder, enc_params.sSpatialLayers[0].iSpatialBitrate = enc_params.iTargetBitrate; enc_params.sSpatialLayers[0].iMaxSpatialBitrate = enc_params.iMaxBitrate; + gst_clear_caps (&allowed_caps); + if (openh264enc->slice_mode == GST_OPENH264_SLICE_MODE_N_SLICES) { if (openh264enc->num_slices == 1) slice_mode = SM_SINGLE_SLICE; @@ -1050,7 +1052,7 @@ gst_openh264enc_handle_frame (GstVideoEncoder * encoder, frame_info.sLayerInfo[i].pNalLengthInByte[j]); } } - headers = g_list_append (headers, gst_buffer_ref (hdr)); + headers = g_list_append (headers, hdr); /* take ownership of hdr */ } gst_buffer_fill (frame->output_buffer, buf_length, frame_info.sLayerInfo[i].pBsBuf, layer_size); buf_length += layer_size; |