Browse Source

avformat/aviobuf: Check that avio_seek() target is non negative

Fixes out of array access

Suggested-by: Andrew Scherkus <scherkus@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed86dbd05d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.4.5
Michael Niedermayer 11 years ago
parent
commit
0d277be45a
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavformat/aviobuf.c

+ 3
- 0
libavformat/aviobuf.c View File

@@ -221,6 +221,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
return offset1;
offset += offset1;
}
if (offset < 0)
return AVERROR(EINVAL);

offset1 = offset - pos;
if (!s->must_flush && (!s->direct || !s->seek) &&
offset1 >= 0 && offset1 <= buffer_size) {


Loading…
Cancel
Save