mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-06-04 19:01:18 +00:00
Fix crash when tga image loader succeeds in loading a 0x0 image
Copy resource bitmaps before using them on a worker thread
This commit is contained in:
parent
e19b2912f3
commit
44d972c876
4 changed files with 14 additions and 5 deletions
|
@ -165,10 +165,10 @@ namespace CodeImp.DoomBuilder.Data
|
|||
data.Position += 9; // Skip some stuff...
|
||||
|
||||
int width = data.ReadByte() + (data.ReadByte() << 8);
|
||||
if(width < 0 || width > 8192) return false;
|
||||
if(width <= 0 || width > 8192) return false;
|
||||
|
||||
int height = data.ReadByte() + (data.ReadByte() << 8);
|
||||
if(height < 0 || height > 8192) return false;
|
||||
if(height <= 0 || height > 8192) return false;
|
||||
|
||||
int bitsperpixel = data.ReadByte(); // Can be 8, 16, 24, 32
|
||||
return (bitsperpixel == 8 || bitsperpixel == 16 || bitsperpixel == 24 || bitsperpixel == 32);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue