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_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…
Add table
Add a link
Reference in a new issue