mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
Fix infinite recursion in CTerrainTextureManager::LoadAlphaMap
When an alphamap set fails to load, the code falls back to the
"standard" set, guarded by a comparison of the full VFS path
("art/textures/terrain/alphamaps/standard") against "standard".
That comparison is always true, so a failure to load the standard set
itself recursed unboundedly and crashed with a stack overflow.
Compare the alphaMapType parameter instead, so the fallback happens at
most once and a broken standard set returns the failure iterator as
intended.
Fixes #8975
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
50e1f51755
commit
28811e3850
1 changed files with 2 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (C) 2025 Wildfire Games.
|
||||
/* Copyright (C) 2026 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
|
|
@ -207,7 +207,7 @@ CTerrainTextureManager::LoadAlphaMap(const VfsPath& alphaMapType)
|
|||
LOGERROR("Failed to load alphamap: %s", alphaMapType.string8());
|
||||
|
||||
const VfsPath standard("standard");
|
||||
if (path != standard)
|
||||
if (alphaMapType != standard)
|
||||
return LoadAlphaMap(standard);
|
||||
return m_TerrainAlphas.end();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue