summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-08 16:46:56 +0100
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2014-04-08 16:46:56 +0100
commit45b8225a0214d8f2a9072ce1ff6006d6aeb6a289 (patch)
tree944e5fd429844e2257698a7cf5e8513bcebf3a7c
parent4b5068f5ddd8cd2cfdb4099094af028f49befa52 (diff)
hls: bring NULL test before dereference
Coverity 1195168
-rw-r--r--ext/hls/m3u8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c
index 851104b60..e1b373373 100644
--- a/ext/hls/m3u8.c
+++ b/ext/hls/m3u8.c
@@ -808,11 +808,11 @@ gst_m3u8_client_get_duration (GstM3U8Client * client)
GST_M3U8_CLIENT_LOCK (client);
/* We can only get the duration for on-demand streams */
- if (!client->current->endlist) {
+ if (!client->current || client->current->endlist) {
GST_M3U8_CLIENT_UNLOCK (client);
return GST_CLOCK_TIME_NONE;
}
- if (client->current && client->current->files)
+ if (client->current->files)
g_list_foreach (client->current->files, (GFunc) _sum_duration, &duration);
GST_M3U8_CLIENT_UNLOCK (client);
return duration;