Fix surface leak if SDLVideo_CreateOverlay() fails

This commit is contained in:
Cameron Gutman 2022-05-28 22:48:49 -05:00
parent f8a6012c3a
commit e9edad6f8c

View file

@ -193,6 +193,7 @@ void SLVideoDecoder::notifyOverlayUpdated(Overlay::OverlayType type)
if (m_Overlay == nullptr) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION,
"SLVideo_CreateOverlay() failed");
SDL_FreeSurface(newSurface);
return;
}