[FFmpeg-cvslog] rtmpproto: Avoid using uninitialized memory

Martin Storsjö git at videolan.org
Tue Jan 21 04:20:33 CET 2014


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri Jan 17 14:29:57 2014 +0200| [24eb3c791606fe98a1591c13a8b2ba6c342bb3b5] | committer: Martin Storsjö

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 at martin.st>

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

 libavformat/rtmpproto.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 135af82..51381a4 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);



More information about the ffmpeg-cvslog mailing list