summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2025-07-11 22:58:26 +0200
committerAndreas Rheinhardt <[email protected]>2025-09-15 17:52:21 +0200
commit987c955cd7e972d9940284fa6ae7187ac858ebb1 (patch)
treee753bd661c07e301e1c052981218809623e26155
parent994bc08325897a7bc86cbb4f8975e1c09272f5d2 (diff)
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
Otherwise it might be > buf_ptr in which case ffio_get_checksum() could segfault (s->buf_ptr - s->checksum_ptr would be negative which would be converted to something very big when converted to unsigned for the update_checksum callback). Fixes ticket #11233. Reported-by: Du4t Signed-off-by: Andreas Rheinhardt <[email protected]>
-rw-r--r--libavformat/aviobuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6a6ec36e28..9beac8bcd5 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -311,7 +311,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
ctx->seek_count++;
if (!s->write_flag)
s->buf_end = s->buffer;
- s->buf_ptr = s->buf_ptr_max = s->buffer;
+ s->checksum_ptr = s->buf_ptr = s->buf_ptr_max = s->buffer;
s->pos = offset;
}
s->eof_reached = 0;