mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-05-08 02:58:30 +00:00
avformat/http: Return an error in case of prematurely ending data
Fixes Ticket 4039 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a40cee03a3
commit
3668701f96
@ -943,6 +943,14 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
|||||||
s->filesize >= 0 && s->off >= s->filesize)
|
s->filesize >= 0 && s->off >= s->filesize)
|
||||||
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 < 0) &&
|
||||||
|
s->filesize >= 0 && s->off < s->filesize) {
|
||||||
|
av_log(h, AV_LOG_ERROR,
|
||||||
|
"Streams ends prematurly at %"PRId64", should be %"PRId64"\n",
|
||||||
|
s->off, s->filesize
|
||||||
|
);
|
||||||
|
return AVERROR(EIO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
s->off += len;
|
s->off += len;
|
||||||
|
Loading…
Reference in New Issue
Block a user