Stop PrivateExtractIcons from crashing given an invalid icon index.

This commit is contained in:
Mike McCormack 2004-07-12 19:53:36 +00:00 committed by Alexandre Julliard
parent f4c813f74b
commit 126884f030
1 changed files with 6 additions and 0 deletions

View File

@ -543,6 +543,12 @@ static UINT ICO_ExtractIconExW(
{
const IMAGE_RESOURCE_DIRECTORY *xresdir;
xresdir = find_entry_by_id(iconresdir, LOWORD(pIconId[i]), rootresdir);
if( !xresdir )
{
WARN("icon entry %d not found\n", LOWORD(pIconId[i]));
RetPtr[i]=0;
continue;
}
xresdir = find_entry_default(xresdir, rootresdir);
idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
idata = NULL;