Merge commit '3c18a7b18807de81566381a1bcbe9f6103c0296b'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 28 Jan 2015 19:37:28 +0000 (20:37 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 28 Jan 2015 19:37:28 +0000 (20:37 +0100)
* commit '3c18a7b18807de81566381a1bcbe9f6103c0296b':
  avio: Do not consider the end-of-buffer position valid

Conflicts:
libavformat/aviobuf.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/aviobuf.c

@@@ -223,12 -204,9 +223,12 @@@ int64_t avio_seek(AVIOContext *s, int64
              return offset1;
          offset += offset1;
      }
 +    if (offset < 0)
 +        return AVERROR(EINVAL);
 +
      offset1 = offset - pos;
 -    if (!s->must_flush &&
 -        offset1 >= 0 && offset1 < (s->buf_end - s->buffer)) {
 +    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 ||