diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-10-09 20:13:54 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-10-10 16:29:06 +0200 |
commit | c27328e749ff3be648411765cd17362fee017341 (patch) | |
tree | ae128bb5441717659fb7d5e95b1dc6cd8649b051 /libavformat | |
parent | 09e1ccc8cddc946da5e10841f10dc5ebdd187d9d (diff) | |
download | ffmpeg-c27328e749ff3be648411765cd17362fee017341.tar.gz |
rtsp: Check for command strings without spaces
Prevent a NULL-pointer dereference.
CC: libav-stable@libav.org
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtspdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index a14ec579d9..5442b7d251 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -360,6 +360,10 @@ 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) + return AVERROR_INVALIDDATA; + if (linept - line > methodsize - 1) { av_log(s, AV_LOG_ERROR, "Method string too long\n"); return AVERROR(EIO); |