I reproduced it
Exception was fired in this methods, there is a possibility that the problem is in the TabFile
The exception was fired at the end, I add a comment
public class PckFile:XCImageCollection
{
private int bpp;
public static readonly string TAB_EXT = ".tab";
public PckFile(Stream pckFile, Stream tabFile,int bpp,Palette pal,int imgHeight,int imgWidth)
{
if(tabFile!=null)
tabFile.Position=0;
pckFile.Position=0;
byte[] info = new byte[pckFile.Length];
pckFile.Read(info,0,info.Length);
pckFile.Close();
this.bpp=bpp;
Pal=pal;
uint[] offsets;
if(tabFile!=null)
{
offsets= new uint[(tabFile.Length/bpp)+1];
BinaryReader br = new BinaryReader(tabFile);
if(bpp==2)
for(int i=0;i<tabFile.Length/bpp;i++)
offsets[i] = br.ReadUInt16();
else
for(int i=0;i<tabFile.Length/bpp;i++)
offsets[i] = br.ReadUInt32(); https://STEP HERE
br.Close();
}
else
{
offsets = new uint[2];
offsets[0]=0;
}
offsets[offsets.Length-1] = (uint)info.Length;
for(int i=0;i<offsets.Length-1;i++)
{
byte[] imgDat = new byte[offsets[i+1]-offsets[i]];
for(int j=0;j<imgDat.Length;j++)
imgDat[j] = info[offsets[i]+j]; https://EXCEPTION: bpp = 4, i = 0, j = 0, offset[0] = 34734080
Add(new PckImage(i,imgDat,pal,this,imgHeight,imgWidth));
}
pckFile.Close();
if(tabFile!=null)
tabFile.Close();
}
now i am sorry but i must go to sleep
tomorrow I will check it better, before I must study MCD/PCK file format to understand the problem