Browse Source

rtmp: Fix a possible access to invalid memory location when the playpath is too short.

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n1.0
Samuel Pitoiset Martin Storsjö 13 years ago
parent
commit
0a9a225733
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavformat/rtmpproto.c

+ 2
- 2
libavformat/rtmpproto.c View File

@@ -1141,11 +1141,11 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
goto fail;
}

if (!strchr(fname, ':') &&
if (!strchr(fname, ':') && len >= 4 &&
(!strcmp(fname + len - 4, ".f4v") ||
!strcmp(fname + len - 4, ".mp4"))) {
memcpy(rt->playpath, "mp4:", 5);
} else if (!strcmp(fname + len - 4, ".flv")) {
} else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) {
fname[len - 4] = '\0';
} else {
rt->playpath[0] = 0;


Loading…
Cancel
Save