Module: libav
Branch: master
Commit: 8e67039c6312ba520945f2c01b7b14df056d5ed1

Author:    John Stebbins <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Thu Jan 12 13:36:26 2017 -0700

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 <[email protected]>

---

 libavformat/asfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 1c50ad6..d602af8 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 &&

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to