rtsp: Make sure we don' t write too many transport entries into a fixed-size array

Message ID 20150424131000.087005DE7B@aruru.libav.org
State New
Headers show

Commit Message

Janne Grunau April 24, 2015, 1:10 p.m.
Module: libav
Branch: master
Commit: b90adb0aba073f9c1b4abca852119947393ced4c

Author:    Martin Storsjö <martin@martin.st>
Committer: Martin Storsjö <martin@martin.st>
Date:      Fri Apr 24 12:38:09 2015 +0300

rtsp: Make sure we don't write too many transport entries into a fixed-size array

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>

---

 libavformat/rtsp.c |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 1b60b4f..cbea685 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -972,6 +972,8 @@  static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
             p++;
 
         reply->nb_transports++;
+        if (reply->nb_transports >= RTSP_MAX_TRANSPORTS)
+            break;
     }
 }