Skip to content
Snippets Groups Projects
Commit 56c23370 authored by Martin Storsjö's avatar Martin Storsjö
Browse files

hls: Avoid reading outside of the allocated array


CC: libav-stable@libav.org
Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent 8c929098
No related branches found
No related tags found
No related merge requests found
...@@ -668,7 +668,8 @@ start: ...@@ -668,7 +668,8 @@ start:
/* Check if this stream still is on an earlier segment number, or /* Check if this stream still is on an earlier segment number, or
* has the packet with the lowest dts */ * has the packet with the lowest dts */
if (var->pkt.data) { 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) { if (minvariant < 0 || var->cur_seq_no < minvar->cur_seq_no) {
minvariant = i; minvariant = i;
} else if (var->cur_seq_no == minvar->cur_seq_no) { } else if (var->cur_seq_no == minvar->cur_seq_no) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment