Fix animated cursor resize crash

This commit is contained in:
Lauri Kasanen
2021-06-15 15:39:48 +03:00
parent 9144045718
commit 29e0e2bd2e
6 changed files with 19 additions and 7 deletions

View File

@@ -579,7 +579,7 @@ void VNCServerST::add_copied(const Region& dest, const Point& delta)
}
void VNCServerST::setCursor(int width, int height, const Point& newHotspot,
const rdr::U8* data)
const rdr::U8* data, const bool resizing)
{
delete cursor;
cursor = new Cursor(width, height, newHotspot, data);
@@ -587,6 +587,13 @@ void VNCServerST::setCursor(int width, int height, const Point& newHotspot,
renderedCursorInvalid = true;
// If an app has an animated cursor on the resized edge, X internals
// will call for it to be rendered. Unlucky for us, the VNC screen
// is currently pointing to freed memory, and a cursor change
// would want to send a screen update. So, don't do that.
if (resizing)
return;
std::list<VNCSConnectionST*>::iterator ci, ci_next;
for (ci = clients.begin(); ci != clients.end(); ci = ci_next) {
ci_next = ci; ci_next++;