From: Tim-Philipp Müller Date: Tue, 20 Apr 2021 18:43:53 +0000 (+0100) Subject: openh264enc: fix caps and header buffer leak X-Git-Tag: 1.19.3~507^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90c1732849c0233dd428d578ebbc481c23a36f4d;p=platform%2Fupstream%2Fgstreamer.git openh264enc: fix caps and header buffer leak Part-of: --- diff --git a/ext/openh264/gstopenh264enc.cpp b/ext/openh264/gstopenh264enc.cpp index 1037941..502eca9 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;