From ccbb7657431f6652c1e114b07bb8d5fe09a1a953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 10 Jul 2010 15:50:50 +0200 Subject: [PATCH] basevideodecoder: Fix memory leak The timestamps are only used if the output adapter is used, not if complete frames are provided by the decoder and finish_frame() is called and even in the case where the output adapter is used they might not be used and are leaked. --- gst-libs/gst/video/gstbasevideodecoder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/video/gstbasevideodecoder.c b/gst-libs/gst/video/gstbasevideodecoder.c index b1a97eb432..90b4e6ca18 100644 --- a/gst-libs/gst/video/gstbasevideodecoder.c +++ b/gst-libs/gst/video/gstbasevideodecoder.c @@ -927,6 +927,9 @@ gst_base_video_decoder_change_state (GstElement * element, if (base_video_decoder_class->stop) { base_video_decoder_class->stop (base_video_decoder); } + g_list_foreach (base_video_decoder->timestamps, (GFunc) g_free, NULL); + g_list_free (base_video_decoder->timestamps); + base_video_decoder->timestamps = NULL; break; default: break;