mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-29 10:52:20 +00:00
avformat/aviobuf: check if requested seekback buffer is already read
Existing code did not check if the requested seekback buffer is already read entirely. In this case, nothing has to be done to guarantee seekback. Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
74c70efd12
commit
6d972beb23
@ -999,6 +999,9 @@ int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size)
|
||||
int filled = s->buf_end - s->buffer;
|
||||
ptrdiff_t checksum_ptr_offset = s->checksum_ptr ? s->checksum_ptr - s->buffer : -1;
|
||||
|
||||
if (buf_size <= s->buf_end - s->buf_ptr)
|
||||
return 0;
|
||||
|
||||
buf_size += s->buf_ptr - s->buffer + max_buffer_size;
|
||||
|
||||
if (buf_size < filled || s->seekable || !s->read_packet)
|
||||
|
Loading…
Reference in New Issue
Block a user