Skip to content

Commit 38cd586

Browse files
authored
bugfix(textureloader): Fix Generals game hang with TextureLoader::Validate_Texture_Size (#1439)
1 parent c08e01d commit 38cd586

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Generals/Code/Libraries/Source/WWVegas/WW3D2/textureloader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ void TextureLoadTaskClass::Begin_Texture_Load()
10461046
DDSFileClass dds_file(Texture->Get_Full_Path(),Get_Reduction());
10471047
if (dds_file.Is_Available()) {
10481048
// Destination size will be the next power of two square from the larger width and height...
1049-
unsigned width, height, depth;
1049+
unsigned width=0, height=0, depth=1;
10501050
width=dds_file.Get_Width(0);
10511051
height=dds_file.Get_Height(0);
10521052
TextureLoader::Validate_Texture_Size(width,height,depth);
@@ -1120,7 +1120,7 @@ void TextureLoadTaskClass::Begin_Texture_Load()
11201120
}
11211121

11221122
// Destination size will be the next power of two square from the larger width and height...
1123-
unsigned width=targa.Header.Width, height=targa.Header.Height, depth;
1123+
unsigned width=targa.Header.Width, height=targa.Header.Height, depth=1;
11241124
int ReductionFactor=Get_Reduction();
11251125
int MipLevels=0;
11261126

Generals/Code/Libraries/Source/WWVegas/WW3D2/texturethumbnail.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ThumbnailClass::ThumbnailClass(const StringClass& filename)
9292
// Destination size will be the next power of two square from the larger width and height...
9393
Width=targa.Header.Width>>reduction_factor;
9494
Height=targa.Header.Height>>reduction_factor;
95-
unsigned depth;
95+
unsigned depth=1;
9696
TextureLoader::Validate_Texture_Size(Width,Height,depth);
9797
unsigned src_width=targa.Header.Width;
9898
unsigned src_height=targa.Header.Height;

0 commit comments

Comments
 (0)