aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-28 20:55:42 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-28 20:56:50 +0100
commit58ed1528574f7e8bfa916b1e03b1406908ebc9f5 (patch)
tree32530fdecfd980e8180eb4b74fc5d129f46f0553
parent0b4fc4bacd866b14b74bcfb1656a1f469da6ad46 (diff)
downloadffmpeg-58ed1528574f7e8bfa916b1e03b1406908ebc9f5.tar.gz
avformat/aviobuf: Allow seeking to the end of the buffer for read only buffers
This undoes the effect of 3c18a7b18807de81566381a1bcbe9f6103c0296b for reading Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/aviobuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 6a1f83acba..3d77a7ff25 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 - s->write_flag) {
/* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1;
} else if ((!s->seekable ||