From 8fde7850c0b775fa1e389579f14f7befd67bc019 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 1 May 2012 14:46:06 +0200 Subject: [PATCH] videodecoder: don't leak frames Frames receive a refcount when added to the frames list so release that refcount in gst_video_decoder_do_finish_frame(). Also release the ref on the frame because gst_video_decoder_do_finish_frame() takes ownership of the passed frame. --- gst-libs/gst/video/gstvideodecoder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 0520234628..11ebb696eb 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -1865,8 +1865,11 @@ static void gst_video_decoder_do_finish_frame (GstVideoDecoder * dec, GstVideoCodecFrame * frame) { + /* unref once from the list */ dec->priv->frames = g_list_remove (dec->priv->frames, frame); + gst_video_codec_frame_unref (frame); + /* unref because this function takes ownership */ gst_video_codec_frame_unref (frame); }