diff options
author | Martin Storsjö <martin@martin.st> | 2013-11-21 11:53:58 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2013-11-22 14:27:10 +0200 |
commit | 56c2337004d5223ae03d08020ad3eb4faa1bebc6 (patch) | |
tree | 78ee14887aa71a9ce84b6136760d3b848290a3a1 | |
parent | 8c929098141ebc94ad3f303521c520bb3dc6d8f6 (diff) | |
download | ffmpeg-56c2337004d5223ae03d08020ad3eb4faa1bebc6.tar.gz |
hls: Avoid reading outside of the allocated array
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/hls.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/hls.c b/libavformat/hls.c index 14fdf8f826..290f12e5bb 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) { |