the conditions on both wIsIcon and wReserved must be met, not just on one of them

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4563 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2006-03-10 21:42:06 +00:00
parent 9cc73c10ea
commit 5691c3f3ff

View file

@ -143,7 +143,7 @@ void replace_icon(CResourceEditor* re, WORD wIconId, const char* filename)
IconGroupHeader igh;
if (!fread(&igh, sizeof(IconGroupHeader), 1, f)) throw runtime_error("unable to read file");
if (igh.wIsIcon != 1 && igh.wReserved != 0) throw runtime_error("invalid icon file");
if (igh.wIsIcon != 1 || igh.wReserved != 0) throw runtime_error("invalid icon file");
BYTE* rsrcIconGroup = (BYTE*)malloc(sizeof(IconGroupHeader) + igh.wCount*SIZEOF_RSRC_ICON_GROUP_ENTRY);
if (!rsrcIconGroup) throw bad_alloc();
@ -211,7 +211,7 @@ unsigned char* generate_uninstall_icon_data(const char* filename, size_t &size)
IconGroupHeader igh;
if (!fread(&igh, sizeof(IconGroupHeader), 1, f)) throw runtime_error("unable to read file");
if (igh.wIsIcon != 1 && igh.wReserved != 0) throw runtime_error("invalid icon file");
if (igh.wIsIcon != 1 || igh.wReserved != 0) throw runtime_error("invalid icon file");
int iNewIconSize = 0;
FileIconGroupEntry ige;