From c55b24b43dd03f09cad17d2eab1510dc0c030020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 2 Apr 2010 19:48:56 +0200 Subject: [PATCH] h264parse: Correctly clean up internal state for reuse Fixes bug #614591. --- gst/h264parse/gsth264parse.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gst/h264parse/gsth264parse.c b/gst/h264parse/gsth264parse.c index 0f23660c21..fca25f223d 100644 --- a/gst/h264parse/gsth264parse.c +++ b/gst/h264parse/gsth264parse.c @@ -963,11 +963,13 @@ gst_h264_parse_reset (GstH264Parse * h264parse) for (i = 0; i < MAX_SPS_COUNT; i++) { if (h264parse->sps_buffers[i]) g_slice_free (GstH264Sps, h264parse->sps_buffers[i]); + h264parse->sps_buffers[i] = NULL; gst_buffer_replace (&h264parse->sps_nals[i], NULL); } for (i = 0; i < MAX_PPS_COUNT; i++) { if (h264parse->pps_buffers[i]) g_slice_free (GstH264Pps, h264parse->pps_buffers[i]); + h264parse->pps_buffers[i] = NULL; gst_buffer_replace (&h264parse->pps_nals[i], NULL); } h264parse->sps = NULL; @@ -993,10 +995,7 @@ gst_h264_parse_reset (GstH264Parse * h264parse) h264parse->last_outbuf_dts = GST_CLOCK_TIME_NONE; list = h264parse->codec_nals; - while (list) { - gst_buffer_unref (list->data); - list = g_slist_next (list); - } + g_slist_foreach (list, (GFunc) gst_buffer_unref, NULL); g_slist_free (h264parse->codec_nals); h264parse->codec_nals = NULL;