aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <stebbins@jetheaddev.com>2017-01-12 13:36:26 -0700
committerLuca Barbato <lu_zero@gentoo.org>2017-02-04 15:21:12 +0100
commit8e67039c6312ba520945f2c01b7b14df056d5ed1 (patch)
tree890980966db108e06b8a4fd841008b5f55be1883
parent7abdd026df6a9a52d07d8174505b33cc89db7bf6 (diff)
downloadffmpeg-8e67039c6312ba520945f2c01b7b14df056d5ed1.tar.gz
asfdec: Use the ASF stream count when iterating
The AVFormat stream count can be larger due external factors, such as an id3 tag appended. Avoid an out of bound read. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r--libavformat/asfdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 1c50ad627c..d602af8793 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1485,7 +1485,7 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
asf->return_subpayload = 0;
return 0;
}
- for (i = 0; i < s->nb_streams; i++) {
+ for (i = 0; i < asf->nb_streams; i++) {
ASFPacket *asf_pkt = &asf->asf_st[i]->pkt;
if (asf_pkt && !asf_pkt->size_left && asf_pkt->data_size) {
if (asf->asf_st[i]->span > 1 &&