What steps will reproduce the problem?
1. download the attachment
2. try open it with mpqtool
What is the expected output? What do you see instead?
在 System.IO.__Error.EndOfFile()
在 System.IO.BinaryReader.FillBuffer(Int32 numBytes)
在 System.IO.BinaryReader.ReadUInt32()
在 MpqReader.MpqBlock..ctor(BinaryReader br, UInt32 HeaderOffset) 位置
E:\Dev\War3Share\Deerchao.War3Share.Components\Mpq\MpqStructs.cs:行号 125
在 MpqReader.MpqArchive.Init() 位置
E:\Dev\War3Share\Deerchao.War3Share.Components\Mpq\MpqArchive.cs:行号 100
在 MpqReader.MpqArchive..ctor(Stream SourceStream) 位置
E:\Dev\War3Share\Deerchao.War3Share.Components\Mpq\MpqArchive.cs:行号 62
What version of the product are you using? On what operating system?
current version.
Please provide any additional information below.
a quick and dirty fix is to change line 99 of MpqArchive.cs from
for (int i = 0; i < mHeader.BlockTableSize; i++)
mBlocks[i] = new MpqBlock(br2, (uint)mHeaderOffset);
to:
for (int i = 0; i < mHeader.BlockTableSize &&
br2.BaseStream.Position!=br2.BaseStream.Length; i++)
mBlocks[i] = new MpqBlock(br2, (uint)mHeaderOffset);
Original issue reported on code.google.com by deerc...@gmail.com on 13 Nov 2007 at 3:59
Original issue reported on code.google.com by
deerc...@gmail.com
on 13 Nov 2007 at 3:59Attachments: