[FFmpeg-cvslog] rtmpproto: Check the return from ff_amf_read_string

Martin Storsjö git at videolan.org
Thu Mar 23 17:35:03 EET 2017


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Thu Oct 13 15:24:54 2016 +0300| [7395784ba72742b6daa62d35db4028e09f3fdf06] | committer: Martin Storsjö

rtmpproto: Check the return from ff_amf_read_string

If this failed, we used to continue with an uninitialized
filename buffer.

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/rtmpproto.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index e7e2479..6402425 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -1918,6 +1918,13 @@ static int send_invoke_response(URLContext *s, RTMPPacket *pkt)
         !strcmp(command, "publish")) {
         ret = ff_amf_read_string(&gbc, filename,
                                  sizeof(filename), &stringlen);
+        if (ret) {
+            if (ret == AVERROR(EINVAL))
+                av_log(s, AV_LOG_ERROR, "Unable to parse stream name - name too long?\n");
+            else
+                av_log(s, AV_LOG_ERROR, "Unable to parse stream name\n");
+            return ret;
+        }
         // check with url
         if (s->filename) {
             pchar = strrchr(s->filename, '/');



More information about the ffmpeg-cvslog mailing list