mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
TextureLoader: unlock surface on failure paths
This commit is contained in:
parent
a3122cd209
commit
5f32188db3
@ -64,6 +64,7 @@ bool TextureLoader::PatchTexture(LegoTextureInfo* p_textureInfo)
|
|||||||
if (details->bits_per_pixel == 8) {
|
if (details->bits_per_pixel == 8) {
|
||||||
SDL_Palette* sdlPalette = SDL_GetSurfacePalette(surface);
|
SDL_Palette* sdlPalette = SDL_GetSurfacePalette(surface);
|
||||||
if (!sdlPalette) {
|
if (!sdlPalette) {
|
||||||
|
p_textureInfo->m_surface->Unlock(desc.lpSurface);
|
||||||
SDL_DestroySurface(surface);
|
SDL_DestroySurface(surface);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -78,6 +79,7 @@ bool TextureLoader::PatchTexture(LegoTextureInfo* p_textureInfo)
|
|||||||
|
|
||||||
LPDIRECTDRAWPALETTE ddPalette = nullptr;
|
LPDIRECTDRAWPALETTE ddPalette = nullptr;
|
||||||
if (pDirectDraw->CreatePalette(DDPCAPS_8BIT | DDPCAPS_ALLOW256, entries, &ddPalette, NULL) != DD_OK) {
|
if (pDirectDraw->CreatePalette(DDPCAPS_8BIT | DDPCAPS_ALLOW256, entries, &ddPalette, NULL) != DD_OK) {
|
||||||
|
p_textureInfo->m_surface->Unlock(desc.lpSurface);
|
||||||
SDL_DestroySurface(surface);
|
SDL_DestroySurface(surface);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user