[FFmpeg-cvslog] rtspdec: check for strchr returning NULL.

Reimar Döffinger git at videolan.org
Sun Apr 6 22:05:16 CEST 2014


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Sun Apr  6 19:42:28 2014 +0200| [a0568ed2544025de3c66dd500811f5ba43f38af4] | committer: Reimar Döffinger

rtspdec: check for strchr returning NULL.

Fixes CID 732244.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a0568ed2544025de3c66dd500811f5ba43f38af4
---

 libavformat/rtspdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 74a7bf6..af20465 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) {
+        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);



More information about the ffmpeg-cvslog mailing list