From c319b1cc8f4e82e2d90ae0e8e4d1f0b20b631fc2 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Tue, 8 Apr 2014 16:53:54 +0100 Subject: [PATCH] hls: only set DISCONT flag on a valid buffer Recent refactoring causes this code to be called with either a NULL fragment, or a non NULL fragment. In the former case, we don't have a buffer. In the latter case, the original code dealing with DISCONT assumed the buffer was valid. Testing for a NULL buffer here thus does not seem to change the intent, and fixes: Coverity 1195147 --- ext/hls/gsthlsdemux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/hls/gsthlsdemux.c b/ext/hls/gsthlsdemux.c index 0968c217b9..83ffc345c7 100644 --- a/ext/hls/gsthlsdemux.c +++ b/ext/hls/gsthlsdemux.c @@ -768,7 +768,8 @@ gst_hls_demux_configure_src_pad (GstHLSDemux * demux, GstFragment * fragment) switch_pads (demux, bufcaps); demux->need_segment = TRUE; demux->discont = FALSE; - GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); + if (buf) + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); } if (bufcaps) gst_caps_unref (bufcaps);