From 17bf17b38d3669f8d1efe9d0c5c428d9170bc52e Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 30 Oct 2021 01:41:51 +0900 Subject: [PATCH] codecs: h265decoder: Fix per-slice leak As documented, slice header parsed via gst_h265_parser_parse_slice_hdr() should be cleared, otherwise it would result in memory leak. Part-of: --- subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c index 177849a..deb9522 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c @@ -650,6 +650,12 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu, return GST_FLOW_ERROR; } + /* NOTE: gst_h265_parser_parse_slice_hdr() allocates array + * GstH265SliceHdr::entry_point_offset_minus1 but we don't use it + * in this h265decoder baseclass at the moment + */ + gst_h265_slice_hdr_free (&priv->current_slice.header); + priv->current_slice.nalu = *nalu; if (priv->current_slice.header.dependent_slice_segment_flag) { -- 2.7.4