summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libavformat/hls.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c
index 14fdf8f..290f12e 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -668,7 +668,8 @@ start:
/* Check if this stream still is on an earlier segment number, or
* has the packet with the lowest dts */
if (var->pkt.data) {
- struct variant *minvar = c->variants[minvariant];
+ struct variant *minvar = minvariant < 0 ?
+ NULL : c->variants[minvariant];
if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
minvariant = i;
} else if (var->cur_seq_no == minvar->cur_seq_no) {
OpenPOWER on IntegriCloud