From: Martin Storsjö Date: Thu, 21 Nov 2013 09:53:58 +0000 (+0200) Subject: hls: Avoid reading outside of the allocated array X-Git-Tag: v10_alpha1~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56c2337004d5223ae03d08020ad3eb4faa1bebc6;p=platform%2Fupstream%2Flibav.git hls: Avoid reading outside of the allocated array CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- 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) {