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

lance.lmwang at gmail.com lance.lmwang at gmail.com
Wed Nov 4 15:37:26 EET 2020


From: Limin Wang <lance.lmwang at gmail.com>

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

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)
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list