fix: guard fsPath underflow, name WMO doodad mask, add why-comments

- asset_manager: add size guard before fsPath.substr(size-4) in
  tryLoadPngOverride — resolveFile could theoretically return a
  path shorter than the extension
- wmo_loader: name kDoodadNameIndexMask (0x00FFFFFF) with why-comment
  explaining the 24-bit name index / 8-bit flags packing and MODN
  string table reference
- window: add why-comment on LOG_WARNING usage during shutdown —
  intentionally elevated so teardown progress is visible at default
  log levels for crash diagnosis
This commit is contained in:
Kelsi 2026-03-30 14:33:08 -07:00
parent 1151785381
commit 086f32174f
3 changed files with 7 additions and 2 deletions

View file

@ -233,6 +233,7 @@ BLPImage AssetManager::tryLoadPngOverride(const std::string& normalizedPath) con
if (fsPath.empty()) return BLPImage();
// Replace .blp/.BLP extension with .png
if (fsPath.size() < 4) return BLPImage();
std::string pngPath = fsPath.substr(0, fsPath.size() - 4) + ".png";
if (!LooseFileReader::fileExists(pngPath)) {
return BLPImage();