1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

hls: Avoid reading outside of the allocated array

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2013-11-21 11:53:58 +02:00
parent 8c92909814
commit 56c2337004

View File

@ -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) {