From: Martin Storsjö <[email protected]>
Seeking to the end of the buffer must trigger an immediate refill
otherwise it would write over unallocated memory.
---
libavformat/aviobuf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6923b78..5f848b2 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -206,7 +206,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int
whence)
}
offset1 = offset - pos;
if (!s->must_flush &&
- offset1 >= 0 && offset1 <= (s->buf_end - s->buffer)) {
+ offset1 >= 0 && offset1 < (s->buf_end - s->buffer)) {
/* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1;
} else if ((!s->seekable ||
--
2.1.0
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel