mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-21 23:53:24 +01:00
Handle pixel formats with odd shift values
Our fast paths assume that each channel fits in to a separate byte. That means the shift needs to be a multiple of 8. Start actually checking this so that a client cannot trip us up and possibly cause incorrect code exection. Issue found by Pavel Cheremushkin from Kaspersky Lab.
This commit is contained in:
parent
ae6cbd19e9
commit
ed73ac2aa7
@ -205,6 +205,12 @@ bool PixelFormat::is888(void) const
|
|||||||
return false;
|
return false;
|
||||||
if (blueMax != 255)
|
if (blueMax != 255)
|
||||||
return false;
|
return false;
|
||||||
|
if ((redShift & 0x7) != 0)
|
||||||
|
return false;
|
||||||
|
if ((greenShift & 0x7) != 0)
|
||||||
|
return false;
|
||||||
|
if ((blueShift & 0x7) != 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user