From 477cbd18b630365d612da173201c2e4ee763d7d4 Mon Sep 17 00:00:00 2001
From: Daniel Richard G <skunk@iSKUNK.ORG>
Date: Sun, 16 Apr 2017 23:12:53 -0400
Subject: [PATCH] avformat/rtsp: check return value of read in ff_rtsp_read_reply()
Signed-off-by: Daniel Richard G <skunk@iSKUNK.ORG>
---
libavformat/rtsp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -1218,7 +1218,11 @@ start:
content = av_malloc(content_length + 1);
if (!content)
return AVERROR(ENOMEM);
- ffurl_read_complete(rt->rtsp_hd, content, content_length);
+ ret = ffurl_read_complete(rt->rtsp_hd, content, content_length);
+ if (ret != content_length) {
+ av_freep(&content);
+ return AVERROR_EOF;
+ }
content[content_length] = '\0';
}
if (content_ptr)
--
2.9.0