avformat/http: return ENOSYS instead of UINT64_MAX for unknown filesize

This matches the behavior of e.g. the pipe: protocol, which returns ENOSYS
on account of ffurl_seek() not being implemented.

The previous behavior of returning s->filesize directly is almost surely a
bug, as s->filesize is UINT64_MAX when never initialized.

Sponsored-by: nxtedition AB
Signed-off-by: Niklas Haas <git@haasn.dev>
This commit is contained in:
Niklas Haas
2026-06-04 17:48:12 +02:00
parent bca473e155
commit 7cb93fb200
+1 -1
View File
@@ -2096,7 +2096,7 @@ static int64_t http_seek_internal(URLContext *h, int64_t off, int whence, int fo
uint8_t discard[4096];
if (whence == AVSEEK_SIZE)
return s->filesize;
return s->filesize == UINT64_MAX ? AVERROR(ENOSYS) : s->filesize;
else if ((s->filesize == UINT64_MAX && whence == SEEK_END))
return AVERROR(ENOSYS);