Fix #317 -- some .img using version 0 instead of version 1

This commit is contained in:
Michaelangel007 2016-04-28 16:08:08 -07:00
parent c4dfbaf988
commit 8a1d39104b
1 changed files with 3 additions and 1 deletions

View File

@ -1041,7 +1041,9 @@ eDetectResult C2IMGHelper::DetectHdr(LPBYTE& pImage, DWORD& dwImageSize, DWORD&
if (dwImageSize < sizeof(Header2IMG) || pHdr->FormatID != FormatID_2IMG || pHdr->HeaderSize != sizeof(Header2IMG))
return eMismatch;
if (pHdr->Version != 1)
// https://github.com/AppleWin/AppleWin/issues/317
// Work around some lazy implementations of the spec that set this value to 0 instead of the correct 1.
if (pHdr->Version > 1)
return eMismatch;
if (dwImageSize < sizeof(Header2IMG)+pHdr->DiskDataLength)