aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-12-07 20:46:34 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-12-07 20:48:07 +0800
commitf1c8c2583277767930da7d7cb6d79b582768c8e6 (patch)
tree24853b7416eeda5587188bda57822f708d1cf713 /libavformat/rtsp.c
parent6d42af02f566c2a14a72bc13517add071c1d2a2b (diff)
downloadffmpeg-f1c8c2583277767930da7d7cb6d79b582768c8e6.tar.gz
avformat/rtsp: fix the error code from ffurl_read_complete()
Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index bf25429187..1e091c7380 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1197,7 +1197,7 @@ start:
ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
av_log(s, AV_LOG_TRACE, "ret=%d c=%02x [%c]\n", ret, ch, ch);
if (ret != 1)
- return AVERROR_EOF;
+ return ret < 0 ? ret : AVERROR(EIO);
if (ch == '\n')
break;
if (ch == '$' && q == buf) {
@@ -1250,9 +1250,9 @@ start:
content = av_malloc(content_length + 1);
if (!content)
return AVERROR(ENOMEM);
- if (ffurl_read_complete(rt->rtsp_hd, content, content_length) != content_length) {
+ if ((ret = ffurl_read_complete(rt->rtsp_hd, content, content_length)) != content_length) {
av_freep(&content);
- return AVERROR(EIO);
+ return ret < 0 ? ret : AVERROR(EIO);
}
content[content_length] = '\0';
}