mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-07-31 19:43:38 +00:00
[common] fix bug in framebuffer_read
This commit is contained in:
parent
4168cc8d78
commit
8ef1aee35c
2 changed files with 4 additions and 2 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
B1-7-gbca54ab1f6+1
|
||||
B1-8-g4168cc8d78+1
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue