rtsp: Make sure we don't write too many transport entries into a fixed-size array
[ffmpeg.git] / libavformat / rtsp.c
index 1b60b4f..cbea685 100644 (file)
@@ -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;
     }
 }