aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2020-09-20 09:32:44 +0200
committerMarton Balint <cus@passwd.hu>2020-10-09 21:07:18 +0200
commit74c70efd12e6a603bc006bd11f7e7806e7c61aca (patch)
treee3c0801cda9530f0abb8410422969dd835bcd0f6
parent358c0bb168aa00fce3075954a0932a1be6d04347 (diff)
downloadffmpeg-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.c2
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);