Message ID | 55E82110.2070504@kamp.de |
---|---|
State | New |
Headers | show |
On Do, 2015-09-03 at 12:29 +0200, Peter Lieven wrote: > - buffer->capacity = pow2ceil(buffer->capacity + len); > + buffer->capacity = pow2ceil(buffer->offset + len); Updated patch. thanks, Gerd
diff --git a/ui/vnc.c b/ui/vnc.c index 8cfd2d8..79d3ff3 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -658,7 +658,7 @@ void vnc_framebuffer_update(VncState *vs, int x, int y, int w, int h, void buffer_reserve(Buffer *buffer, size_t len) { if ((buffer->capacity - buffer->offset) < len) { - buffer->capacity = pow2ceil(buffer->capacity + len); + buffer->capacity = pow2ceil(buffer->offset + len); buffer->capacity = MAX(buffer->capacity, BUFFER_MIN_INIT_SIZE); buffer->buffer = g_realloc(buffer->buffer, buffer->capacity); }