diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index b4b4f12556..bb27a76763 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -360,10 +360,12 @@ static inline int parse_command_line(AVFormatContext *s, const char *line, RTSPState *rt = s->priv_data; const char *linept, *searchlinept; linept = strchr(line, ' '); + if (!linept) { av_log(s, AV_LOG_ERROR, "Error parsing method string\n"); return AVERROR_INVALIDDATA; } + if (linept - line > methodsize - 1) { av_log(s, AV_LOG_ERROR, "Method string too long\n"); return AVERROR(EIO);