From 8ef1aee35cd0a74d579e990b0f1a69cb71a408fd Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Wed, 9 Oct 2019 14:11:45 +1100 Subject: [PATCH] [common] fix bug in framebuffer_read --- VERSION | 2 +- common/src/framebuffer.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index d08092c6..c0b18f8a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-7-gbca54ab1f6+1 \ No newline at end of file +B1-8-g4168cc8d78+1 \ No newline at end of file diff --git a/common/src/framebuffer.c b/common/src/framebuffer.c index 7d9a7da4..7dbbb258 100644 --- a/common/src/framebuffer.c +++ b/common/src/framebuffer.c @@ -31,6 +31,7 @@ struct stFrameBuffer bool framebuffer_read(const FrameBuffer frame, void * dst, size_t size) { + uint8_t *d = (uint8_t*)dst; uint64_t rp = 0; while(rp < size) { @@ -39,8 +40,9 @@ bool framebuffer_read(const FrameBuffer frame, void * dst, size_t size) /* copy what we can */ uint64_t avail = frame->wp - rp; - memcpy(dst, frame->data + rp, avail); + memcpy(d, frame->data + rp, avail); rp += avail; + d += avail; } return true; }