mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Fix UAF in SLVideo overlay update
This commit is contained in:
parent
5ea79efe4b
commit
216f274a92
1 changed files with 3 additions and 3 deletions
|
@ -204,14 +204,14 @@ void SLVideoDecoder::notifyOverlayUpdated(Overlay::OverlayType type)
|
|||
SDL_ConvertPixels(newSurface->w, newSurface->h, newSurface->format->format, newSurface->pixels, newSurface->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
|
||||
float flWidth = (float)newSurface->w / m_ViewportWidth;
|
||||
float flHeight = (float)newSurface->h / m_ViewportHeight;
|
||||
SLVideo_SetOverlayDisplayArea(m_Overlay, 0.0f, 1.0f - flHeight, flWidth, flHeight);
|
||||
|
||||
// We're done with the surface now
|
||||
SDL_FreeSurface(newSurface);
|
||||
|
||||
// Show the overlay
|
||||
SLVideo_ShowOverlay(m_Overlay);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue