This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 75cf5752574b6f178d12b16cdc82e5d9521affde
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun Jun 14 11:44:33 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Mon Aug 31 19:10:45 2026 +0000

    avformat/shared: hard-error on -cache_verify data mismatch
    
    Makes this debug option way more useful. Also matches the existing behavior
    on CRC mismatches.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 doc/protocols.texi   | 4 ++--
 libavformat/shared.c | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index f7e65b1c9d..9790317d28 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1716,8 +1716,8 @@ be initialized if it does not already exist.
 
 @item cache_verify
 If true, verify any data read from the cache against the underlying input
-stream, and report any mismatches. Note that this will make the cache layer
-effectively useless. This is purely a debug option.
+stream, and error out on any mismatches. Note that this will make the cache
+layer effectively useless. This is purely a debug option.
 
 @item cache_timeout
 If set to a nonzero value, specifies the maximum time (in microseconds) to wait
diff --git a/libavformat/shared.c b/libavformat/shared.c
index b1ca6d72f2..0be503f9c2 100644
--- a/libavformat/shared.c
+++ b/libavformat/shared.c
@@ -753,6 +753,8 @@ read_block:
         if (ret < 0) {
             av_assert1(!acquired);
             return ret;
+        } else {
+            s->inner_pos = inner_pos + ret;
         }
 
         /* Verify the read data against the cached data if requested */
@@ -760,9 +762,10 @@ read_block:
             av_log(h, AV_LOG_ERROR, "Cache verification failed for %d bytes "
                    "in block 0x%"PRIx64" at offset 0x%"PRIx64" + %"PRId64"!\n",
                    ret, block_id, block_pos, offset);
+            return AVERROR(EIO);
         }
 
-        s->pos = s->inner_pos = inner_pos + ret;
+        s->pos = s->inner_pos;
         return ret;
     }
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to