Message ID | 20200929211021.25030-1-cus@passwd.hu |
---|---|
State | Accepted |
Headers | show |
Series | [FFmpeg-devel,1/9] avformat/aviobuf: write data into the IO buffer till the very end of the buffer | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
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);
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> --- libavformat/aviobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)