diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 0f7495f59..cc083c88a 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,10 @@ -April 28, 2009 (Changes by Graf Zahl) +April 29, 2009 +- Fixed: FWadCollection::CheckNumForName() read the lump each iteration before + checking for the end marker. On 32-bit systems, this is -1, but on 64-bit + systems, it is a very large integer that is highly unlikely to be in mapped + memory. + +April 28, 2009 (Changes by Graf Zahl) - Added ML_BLOCKUSE line flag, accessible through UDMF and Line_SetBlocking. April 25, 2009 (Changes by Graf Zahl) diff --git a/lzma/C/CpuArch.h b/lzma/C/CpuArch.h index 006361f2f..db441641b 100644 --- a/lzma/C/CpuArch.h +++ b/lzma/C/CpuArch.h @@ -47,6 +47,8 @@ about these properties of platform. #if defined(LITTLE_ENDIAN_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300) +unsigned long _byteswap_ulong(unsigned long); +unsigned __int64 _byteswap_uint64(unsigned __int64); #pragma intrinsic(_byteswap_ulong) #pragma intrinsic(_byteswap_uint64) #define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p)) diff --git a/src/w_wad.cpp b/src/w_wad.cpp index a303310f7..73d45e9b7 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -418,6 +418,7 @@ int FWadCollection::CheckNumForName (const char *name, int space) int FWadCollection::CheckNumForName (const char *name, int space, int wadnum, bool exact) { + FResourceLump *lump; char uname[8]; DWORD i; @@ -428,18 +429,16 @@ int FWadCollection::CheckNumForName (const char *name, int space, int wadnum, bo uppercopy (uname, name); i = FirstLumpIndex[LumpNameHash (uname) % NumLumps]; - FResourceLump *lump = LumpInfo[i].lump; // If exact is true if will only find lumps in the same WAD, otherwise // also those in earlier WADs. while (i != NULL_INDEX && - (*(QWORD *)&lump->Name != *(QWORD *)&uname || + (lump = LumpInfo[i].lump, *(QWORD *)&lump->Name != *(QWORD *)&uname || lump->Namespace != space || (exact? (LumpInfo[i].wadnum != wadnum) : (LumpInfo[i].wadnum > wadnum)) )) { i = NextLumpIndex[i]; - lump = LumpInfo[i].lump; } return i != NULL_INDEX ? i : -1;