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)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 19 May 2015 11:12:57 +0000 (12:12 +0100)
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtsp.c

index 4e79bc12d64ec7ff2a2b61f300382229f7ed897b..3d040d308dbd69e7db7e5be5a42506a766e68b7c 100644 (file)
@@ -927,6 +927,8 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
             p++;
 
         reply->nb_transports++;
+        if (reply->nb_transports >= RTSP_MAX_TRANSPORTS)
+            break;
     }
 }