[FFmpeg-cvslog] rtmp: Fix a possible access to invalid memory location when the playpath is too short .

Samuel Pitoiset git at videolan.org
Tue Jun 12 20:59:32 CEST 2012


ffmpeg | branch: master | Samuel Pitoiset <samuel.pitoiset at gmail.com> | Mon Jun 11 14:21:32 2012 +0200| [0a9a2257339c8697be31e64b36fa6208132b11bd] | committer: Martin Storsjö

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

Signed-off-by: Martin Storsjö <martin at martin.st>

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

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

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index e9a3e43..56011f1 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -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;



More information about the ffmpeg-cvslog mailing list