mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-02 15:55:39 +00:00
Fix use-after-free in VDPAU overlay rendering
This commit is contained in:
parent
027c8dcd41
commit
dcbf5affda
@ -385,9 +385,6 @@ void VDPAURenderer::notifyOverlayUpdated(Overlay::OverlayType type)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Surface data is no longer needed
|
|
||||||
SDL_FreeSurface(newSurface);
|
|
||||||
|
|
||||||
VdpRect overlayRect;
|
VdpRect overlayRect;
|
||||||
|
|
||||||
if (type == Overlay::OverlayStatusUpdate) {
|
if (type == Overlay::OverlayStatusUpdate) {
|
||||||
@ -404,6 +401,9 @@ void VDPAURenderer::notifyOverlayUpdated(Overlay::OverlayType type)
|
|||||||
overlayRect.x1 = overlayRect.x0 + newSurface->w;
|
overlayRect.x1 = overlayRect.x0 + newSurface->w;
|
||||||
overlayRect.y1 = overlayRect.y0 + newSurface->h;
|
overlayRect.y1 = overlayRect.y0 + newSurface->h;
|
||||||
|
|
||||||
|
// Surface data is no longer needed
|
||||||
|
SDL_FreeSurface(newSurface);
|
||||||
|
|
||||||
SDL_LockMutex(m_OverlayMutex);
|
SDL_LockMutex(m_OverlayMutex);
|
||||||
m_OverlaySurface[type] = newBitmapSurface;
|
m_OverlaySurface[type] = newBitmapSurface;
|
||||||
m_OverlayRect[type] = overlayRect;
|
m_OverlayRect[type] = overlayRect;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user