Browse Source

rtspdec: check for strchr returning NULL.

Fixes CID 732244.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
tags/n2.3
Reimar Döffinger 11 years ago
parent
commit
a0568ed254
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/rtspdec.c

+ 4
- 0
libavformat/rtspdec.c View File

@@ -360,6 +360,10 @@ static inline int parse_command_line(AVFormatContext *s, const char *line,
RTSPState *rt = s->priv_data; RTSPState *rt = s->priv_data;
const char *linept, *searchlinept; const char *linept, *searchlinept;
linept = strchr(line, ' '); linept = strchr(line, ' ');
if (!linept) {
av_log(s, AV_LOG_ERROR, "Error parsing method string\n");
return AVERROR_INVALIDDATA;
}
if (linept - line > methodsize - 1) { if (linept - line > methodsize - 1) {
av_log(s, AV_LOG_ERROR, "Method string too long\n"); av_log(s, AV_LOG_ERROR, "Method string too long\n");
return AVERROR(EIO); return AVERROR(EIO);


Loading…
Cancel
Save