Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Core/Libraries/Source/WWVegas/WW3D2/render2dsentence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,27 @@ Render2DSentenceClass::Build_Textures ()
// Create the new texture
//
TextureClass *new_texture = W3DNEW TextureClass (desc.Width, desc.Width, WW3D_FORMAT_A4R4G4B4, MIP_LEVELS_1);

//
// Validate that texture allocation succeeded
//
if (new_texture == nullptr) {
REF_PTR_RELEASE (curr_surface);
continue;
}

SurfaceClass *texture_surface = new_texture->Get_Surface_Level ();

//
// Validate that the texture surface is valid before using it
//
if (texture_surface == nullptr || !texture_surface->Is_Valid()) {
REF_PTR_RELEASE (texture_surface);
REF_PTR_RELEASE (new_texture);
REF_PTR_RELEASE (curr_surface);
continue;
}

new_texture->Get_Filter().Set_U_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP);
new_texture->Get_Filter().Set_V_Addr_Mode(TextureFilterClass::TEXTURE_ADDRESS_CLAMP);
new_texture->Get_Filter().Set_Min_Filter(TextureFilterClass::FILTER_TYPE_NONE);
Expand Down
Loading