mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
rtmp: Fix a possible access to invalid memory location when the playpath is too short.
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
f862537de8
commit
0a9a225733
@ -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…
Reference in New Issue
Block a user