mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[client] added extra sanity checks to the header's data format
This commit is contained in:
parent
81f1b43581
commit
3899556cbf
@ -223,7 +223,14 @@ int renderThread(void * unused)
|
|||||||
// check the header's magic and version are valid
|
// check the header's magic and version are valid
|
||||||
if (
|
if (
|
||||||
memcmp(header.magic, KVMFR_HEADER_MAGIC, sizeof(KVMFR_HEADER_MAGIC)) != 0 ||
|
memcmp(header.magic, KVMFR_HEADER_MAGIC, sizeof(KVMFR_HEADER_MAGIC)) != 0 ||
|
||||||
header.version != KVMFR_HEADER_VERSION
|
header.version != KVMFR_HEADER_VERSION ||
|
||||||
|
(
|
||||||
|
header.dataPos == 0 ||
|
||||||
|
header.width == 0 ||
|
||||||
|
header.height == 0 ||
|
||||||
|
header.stride == 0 ||
|
||||||
|
header.frameType >= FRAME_TYPE_MAX
|
||||||
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
|
Loading…
Reference in New Issue
Block a user