[rtmpdump] [PATCH] Limit length of filename

Steven Penny svnpenn at gmail.com
Mon May 21 11:27:29 CEST 2012


In some cases YouTube RTMPE streams are generating filenames over 300 characters
in length. Worst I saw was 336. Certain operating systems do not support names
of this length. From my tests I set the limit to the max allowed.
---
 rtmpsrv.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/rtmpsrv.c b/rtmpsrv.c
index 9aa62f3..16ac4c1 100644
--- a/rtmpsrv.c
+++ b/rtmpsrv.c
@@ -711,6 +711,12 @@ ServeInvoke(STREAMING_SERVER *server, RTMP * r, RTMPPacket *packet, unsigned int
 	    if (*p == ':')
 	      *p = '_';
 
+	  /* Limit length of filename */
+	  if (av.av_len > 223)
+	    {
+	      av.av_len = 223;
+	    }
+
 	  /* Add extension if none present */
 	  if (file[av.av_len - 4] != '.')
 	    {
-- 
1.7.9



More information about the rtmpdump mailing list