mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avformat/http: return EIO if s->hd is NULL
This could conceivably happen currently if the user tries reading more bytes after the last chunk has already been received. In this case, we currently segfault - but simply returning AVERROR(EIO) seems more reasonable and lets the higher end retry the connection in this case.
This commit is contained in:
@@ -1658,6 +1658,9 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
|
||||
HTTPContext *s = h->priv_data;
|
||||
int len;
|
||||
|
||||
if (!s->hd)
|
||||
return AVERROR(EIO);
|
||||
|
||||
if (s->chunksize != UINT64_MAX) {
|
||||
if (s->chunkend) {
|
||||
return AVERROR_EOF;
|
||||
|
||||
Reference in New Issue
Block a user