This commit is contained in:
Igor Pavlov
2018-12-30 14:01:47 +00:00
committed by Kornel
parent 18dc2b4161
commit 5b2a99c548
113 changed files with 1805 additions and 932 deletions
+13 -1
View File
@@ -788,9 +788,21 @@ HRESULT CHandler::Open2(IInStream *stream)
if (headSize != RSRC_HEAD_SIZE
|| footerOffset >= rsrcPair.Len
|| mainDataSize >= rsrcPair.Len
|| footerOffset + footerSize != rsrcPair.Len
|| footerOffset < mainDataSize
|| footerOffset != headSize + mainDataSize)
return S_FALSE;
const UInt32 footerEnd = footerOffset + footerSize;
if (footerEnd != rsrcPair.Len)
{
// there is rare case dmg example, where there are 4 additional bytes
UInt64 rem = rsrcPair.Len - footerOffset;
if (rem < footerSize
|| rem - footerSize != 4
|| Get32(p + footerEnd) != 0)
return S_FALSE;
}
if (footerSize < 16)
return S_FALSE;
if (memcmp(p, p + footerOffset, 16) != 0)