From 6b89494e2eef09e8aa93dbde4dcd43734207cabf Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Tue, 21 Nov 2023 01:41:16 +0900 Subject: [PATCH] h264decoder: Fix GstVideoCodecFrame leak If current buffer has no slice data, frame should be released. Otherwise frames will stay in decoder baseclass forever. Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c index 3d85f5f..2c90d34 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c @@ -1870,8 +1870,16 @@ gst_h264_decoder_finish_current_picture (GstH264Decoder * self, GstH264DecoderClass *klass; GstFlowReturn flow_ret = GST_FLOW_OK; - if (!priv->current_picture) + if (!priv->current_picture) { + if (priv->current_frame) { + GST_DEBUG_OBJECT (self, + "AU buffer without slice data, releasing current frame %u", + priv->current_frame->system_frame_number); + gst_video_decoder_release_frame (GST_VIDEO_DECODER_CAST (self), + gst_video_codec_frame_ref (priv->current_frame)); + } return; + } klass = GST_H264_DECODER_GET_CLASS (self); -- 2.7.4