diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 91f18b6088..8055a9fbee 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2833,6 +2833,12 @@ reconnect: "FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT); } } + if ( strlen(rt->flashver) > FLASHVER_MAX_LENGTH + || strlen(rt->tcurl ) > TCURL_MAX_LENGTH + ) { + ret = AVERROR(EINVAL); + goto fail; + } rt->receive_report_size = 1048576; rt->bytes_read = 0;