This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 5dd020faffa831b0a4a5ad2607429873e855f07a Author: Niklas Haas <[email protected]> AuthorDate: Wed Jun 10 13:42:22 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Sun Jun 14 11:10:12 2026 +0200 avformat/shared: error out if filesize does not match expected If this happens, something is almost surely wrong with the cache file (e.g. mismatched source file), so it's much better to error out rather than hit silent data corruption. Sponsored-by: nxtedition AB Signed-off-by: Niklas Haas <[email protected]> --- libavformat/shared.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libavformat/shared.c b/libavformat/shared.c index cdeca74b78..5ca3b718df 100644 --- a/libavformat/shared.c +++ b/libavformat/shared.c @@ -292,8 +292,11 @@ static int shared_open(URLContext *h, const char *arg, int flags, AVDictionary * if (filesize < 0 && filesize != AVERROR(ENOSYS)) { ret = (int) filesize; goto fail; - } else if (filesize > 0) - set_filesize(h, filesize); + } else if (filesize > 0) { + ret = set_filesize(h, filesize); + if (ret < 0) + goto fail; + } } if (filesize > 0) { @@ -804,8 +807,10 @@ static int64_t shared_seek(URLContext *h, int64_t pos, int whence) if (filesize) return filesize; res = ffurl_seek(s->inner, pos, whence); - if (res > 0) - set_filesize(h, res); + if (res > 0) { + if (set_filesize(h, res) < 0) + return AVERROR(EINVAL); + } return res; case SEEK_SET: break; @@ -821,7 +826,9 @@ static int64_t shared_seek(URLContext *h, int64_t pos, int whence) res = ffurl_seek(s->inner, pos, whence); if (res < 0) return res; - set_filesize(h, res - pos); /* Opportunistically update known filesize */ + /* Opportunistically update known filesize */ + if (set_filesize(h, res - pos) < 0) + return AVERROR(EINVAL); av_log(h, AV_LOG_DEBUG, "Inner seek to 0x%"PRIx64"\n", res); return s->pos = s->inner_pos = res; default: _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
