Commit ed86dbd0 authored by Michael Niedermayer's avatar Michael Niedermayer

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

Fixes out of array access
Suggested-by: 's avatarAndrew Scherkus <scherkus@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6de2f027
......@@ -223,6 +223,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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment