mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-18 02:22:52 +00:00
Fix UAF in SLVideo overlay update
This commit is contained in:
parent
5ea79efe4b
commit
216f274a92
@ -204,14 +204,14 @@ void SLVideoDecoder::notifyOverlayUpdated(Overlay::OverlayType type)
|
|||||||
SDL_ConvertPixels(newSurface->w, newSurface->h, newSurface->format->format, newSurface->pixels, newSurface->pitch,
|
SDL_ConvertPixels(newSurface->w, newSurface->h, newSurface->format->format, newSurface->pixels, newSurface->pitch,
|
||||||
SDL_PIXELFORMAT_ARGB8888, pixels, pitch);
|
SDL_PIXELFORMAT_ARGB8888, pixels, pitch);
|
||||||
|
|
||||||
// We're done with the surface now
|
|
||||||
SDL_FreeSurface(newSurface);
|
|
||||||
|
|
||||||
// Position the status overlay at the bottom left corner
|
// Position the status overlay at the bottom left corner
|
||||||
float flWidth = (float)newSurface->w / m_ViewportWidth;
|
float flWidth = (float)newSurface->w / m_ViewportWidth;
|
||||||
float flHeight = (float)newSurface->h / m_ViewportHeight;
|
float flHeight = (float)newSurface->h / m_ViewportHeight;
|
||||||
SLVideo_SetOverlayDisplayArea(m_Overlay, 0.0f, 1.0f - flHeight, flWidth, flHeight);
|
SLVideo_SetOverlayDisplayArea(m_Overlay, 0.0f, 1.0f - flHeight, flWidth, flHeight);
|
||||||
|
|
||||||
|
// We're done with the surface now
|
||||||
|
SDL_FreeSurface(newSurface);
|
||||||
|
|
||||||
// Show the overlay
|
// Show the overlay
|
||||||
SLVideo_ShowOverlay(m_Overlay);
|
SLVideo_ShowOverlay(m_Overlay);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user