opengl: Fix QemuPipeStream::readFully reading beyond end of buffer
When GPU emulation is enabled, the emulator sometimes freezes, with an
error message in logcat similar to the following:
QemuPipeStream::readFully failed (buf 0x7f9cd8ab8000): Bad address
Some users have reported the same issue, e.g.:
The root cause is that QemuPipeStream::readFully(void *buf, size_t len)
may attempt to read beyond (buf + len), resulting in a -EFAULT return
value from the goldfish/qemu pipe driver.
Fix this bug to improve the stability of the emulator. In addition,
- Add more information to the said error message to facilitate future
- Use "%zu" instead of "%d" for logging size_t variables.
Signed-off-by: Yu Ning <email@example.com>
Signed-off-by: Pengcheng Chen <firstname.lastname@example.org>
1 file changed