avformat/aviobuf: write data into the IO buffer till the very end of the buffer

There was an off-by-one error when checking if the IO buffer still has enough
space till the end. One more byte can be safely written.

Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Marton Balint 2020-09-20 09:32:44 +02:00
parent 358c0bb168
commit 74c70efd12
1 changed files with 1 additions and 1 deletions

View File

@ -540,7 +540,7 @@ static void fill_buffer(AVIOContext *s)
{
int max_buffer_size = s->max_packet_size ?
s->max_packet_size : IO_BUFFER_SIZE;
uint8_t *dst = s->buf_end - s->buffer + max_buffer_size < s->buffer_size ?
uint8_t *dst = s->buf_end - s->buffer + max_buffer_size <= s->buffer_size ?
s->buf_end : s->buffer;
int len = s->buffer_size - (dst - s->buffer);