You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -1197,7 +1197,7 @@ start:
|
|||||||
ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
|
ret = ffurl_read_complete(rt->rtsp_hd, &ch, 1);
|
||||||
av_log(s, AV_LOG_TRACE, "ret=%d c=%02x [%c]\n", ret, ch, ch);
|
av_log(s, AV_LOG_TRACE, "ret=%d c=%02x [%c]\n", ret, ch, ch);
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
return AVERROR_EOF;
|
return ret < 0 ? ret : AVERROR(EIO);
|
||||||
if (ch == '\n')
|
if (ch == '\n')
|
||||||
break;
|
break;
|
||||||
if (ch == '$' && q == buf) {
|
if (ch == '$' && q == buf) {
|
||||||
@@ -1250,9 +1250,9 @@ start:
|
|||||||
content = av_malloc(content_length + 1);
|
content = av_malloc(content_length + 1);
|
||||||
if (!content)
|
if (!content)
|
||||||
return AVERROR(ENOMEM);
|
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);
|
av_freep(&content);
|
||||||
return AVERROR(EIO);
|
return ret < 0 ? ret : AVERROR(EIO);
|
||||||
}
|
}
|
||||||
content[content_length] = '\0';
|
content[content_length] = '\0';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user