diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 0b0748e954..6a1f83acba 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -228,7 +228,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) offset1 = offset - pos; if (!s->must_flush && (!s->direct || !s->seek) && - offset1 >= 0 && offset1 <= buffer_size) { + offset1 >= 0 && offset1 < buffer_size) { /* can do the seek inside the buffer */ s->buf_ptr = s->buffer + offset1; } else if ((!s->seekable ||