diff mbox series

[FFmpeg-devel,5/6] avformat/rtsp: check return value of ffurl_read_complete

Message ID 1604497047-30429-5-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit aa1fab6934baf3528a5a344511e6bb3a19f6ff6f
Headers show
Series [FFmpeg-devel,1/6] avformat/rtsp: 16384 -> SDP_MAX_SIZE | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Lance Wang Nov. 4, 2020, 1:37 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/rtsp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 3a1afa0..fc32e97 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1228,7 +1228,8 @@  start:
         content = av_malloc(content_length + 1);
         if (!content)
             return AVERROR(ENOMEM);
-        ffurl_read_complete(rt->rtsp_hd, content, content_length);
+        if (ffurl_read_complete(rt->rtsp_hd, content, content_length) != content_length)
+            return AVERROR(EIO);
         content[content_length] = '\0';
     }
     if (content_ptr)