You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
http: Check for AVERROR_EOF in the check for premature end
When the check was added (in3668701f96
, in 2015), some IO functions returned 0 on EOF (in particular, the TCP protocol did, but the TLS protocol returned AVERROR_EOF). Since0e1f771d22
in 2017, the TCP protocol also returns AVERROR_EOF instead of 0, making the check for premature end never have the intended effect. Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -1436,7 +1436,8 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
|||||||
if ((!s->willclose || s->chunksize == UINT64_MAX) && s->off >= target_end)
|
if ((!s->willclose || s->chunksize == UINT64_MAX) && s->off >= target_end)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
len = ffurl_read(s->hd, buf, size);
|
len = ffurl_read(s->hd, buf, size);
|
||||||
if (!len && (!s->willclose || s->chunksize == UINT64_MAX) && s->off < target_end) {
|
if ((!len || len == AVERROR_EOF) &&
|
||||||
|
(!s->willclose || s->chunksize == UINT64_MAX) && s->off < target_end) {
|
||||||
av_log(h, AV_LOG_ERROR,
|
av_log(h, AV_LOG_ERROR,
|
||||||
"Stream ends prematurely at %"PRIu64", should be %"PRIu64"\n",
|
"Stream ends prematurely at %"PRIu64", should be %"PRIu64"\n",
|
||||||
s->off, target_end
|
s->off, target_end
|
||||||
|
Reference in New Issue
Block a user