From d8117471f6c4249997aa3fbd9affe73c1d30637a Mon Sep 17 00:00:00 2001 From: Julien Moutte Date: Thu, 4 Feb 2010 19:45:42 +0100 Subject: [PATCH] mpegtsmux: Fix a potential unref of a NULL pointer. At first iteration we don't have any cached SPS/PPS buffer to free. --- gst/mpegtsmux/mpegtsmux_h264.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gst/mpegtsmux/mpegtsmux_h264.c b/gst/mpegtsmux/mpegtsmux_h264.c index a3c4085d94..7188ce7c09 100644 --- a/gst/mpegtsmux/mpegtsmux_h264.c +++ b/gst/mpegtsmux/mpegtsmux_h264.c @@ -130,8 +130,10 @@ mpegtsmux_process_codec_data_h264 (MpegTsPadData * data, MpegTsMux * mux) /* Detect a codec data change */ if (h264_data->last_codec_data != data->codec_data) { - gst_buffer_unref (h264_data->cached_es); - h264_data->cached_es = NULL; + if (h264_data->cached_es) { + gst_buffer_unref (h264_data->cached_es); + h264_data->cached_es = NULL; + } ret = TRUE; }