rtsp: Make sure we don't write too many transport entries into a fixed-size array
authorMartin Storsjö <martin@martin.st>
Fri, 24 Apr 2015 09:38:09 +0000 (12:38 +0300)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 10 Jun 2015 00:13:12 +0000 (02:13 +0200)
(cherry picked from commit b90adb0aba073f9c1b4abca852119947393ced4c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtsp.c

index 6310d79..1abb471 100644 (file)
@@ -821,6 +821,8 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
             p++;
 
         reply->nb_transports++;
+        if (reply->nb_transports >= RTSP_MAX_TRANSPORTS)
+            break;
     }
 }