[librptexture] ICOPrivate::loadImage_WinVista_PNG(): Use res.pBestIcon->nID instead of res.id.

res.id may have accidentally worked because it was set to -1, but it's
the ID of the RT_GROUP_ICON, not the RT_ICON.
This commit is contained in:
David Korth 2025-06-12 21:11:41 -04:00
parent 783d384b04
commit 704a5eead5

View File

@ -891,7 +891,7 @@ rp_image_const_ptr ICOPrivate::loadImage_WinVista_PNG(void)
if (rt != 0) {
// Load the PNG from a resource.
const auto &res = *(dir.res);
f_png = res.resReader->open(rt, res.id, res.lang);
f_png = res.resReader->open(rt, le16_to_cpu(res.pBestIcon->nID), res.lang);
} else {
// NOTE: PartitionFile only supports IDiscReader, so we'll need to
// create a dummy DiscReader object.