diff options
author | Martin Storsjö <martin@martin.st> | 2014-01-17 14:29:57 +0200 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2014-01-20 21:56:57 +0200 |
commit | 24eb3c791606fe98a1591c13a8b2ba6c342bb3b5 (patch) | |
tree | 7e9a8bcb29d415fa53a3959deec222584e37401f | |
parent | d01e684186bc1631bc176f06b89d33c27ec0d24d (diff) | |
download | ffmpeg-24eb3c791606fe98a1591c13a8b2ba6c342bb3b5.tar.gz |
rtmpproto: Avoid using uninitialized memory
If the url ends with .flv, we stripped it but didn't initialize
rt->playpath, doing av_strlcat on an uninitialized buffer.
Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r-- | libavformat/rtmpproto.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 135af82daa..51381a4d0c 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2510,9 +2510,9 @@ reconnect: (!strcmp(fname + len - 4, ".f4v") || !strcmp(fname + len - 4, ".mp4"))) { memcpy(rt->playpath, "mp4:", 5); - } else if (len >= 4 && !strcmp(fname + len - 4, ".flv")) { - fname[len - 4] = '\0'; } else { + if (len >= 4 && !strcmp(fname + len - 4, ".flv")) + fname[len - 4] = '\0'; rt->playpath[0] = 0; } av_strlcat(rt->playpath, fname, PLAYPATH_MAX_LENGTH); |