Skip to content

Commit

Permalink
[common] fix bug in framebuffer_read
Browse files Browse the repository at this point in the history
  • Loading branch information
gnif committed Oct 9, 2019
1 parent 4168cc8 commit 8ef1aee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
B1-7-gbca54ab1f6+1
B1-8-g4168cc8d78+1
4 changes: 3 additions & 1 deletion common/src/framebuffer.c
Expand Up @@ -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)
{
Expand All @@ -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;
}
Expand Down

0 comments on commit 8ef1aee

Please sign in to comment.