diff options
author | Marton Balint <cus@passwd.hu> | 2020-09-20 09:32:44 +0200 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-10-09 21:07:18 +0200 |
commit | 74c70efd12e6a603bc006bd11f7e7806e7c61aca (patch) | |
tree | e3c0801cda9530f0abb8410422969dd835bcd0f6 | |
parent | 358c0bb168aa00fce3075954a0932a1be6d04347 (diff) | |
download | ffmpeg-74c70efd12e6a603bc006bd11f7e7806e7c61aca.tar.gz |
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>
-rw-r--r-- | libavformat/aviobuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index a77517d712..9675425349 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -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); |