* Fixed an EOC marker sanity check in CSJ2K that was potentially reading past the end of the stream

* If CSJ2K packet decoding tries to read past the end of the stream, just terminate the decoding and return what we have so far instead of throwing an exception. This experimental fix should improve the JPEG2000 decoding success rate

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3406 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2010-08-04 22:01:25 +00:00
parent a2b82eb7fe
commit 984c1c6e4d
2 changed files with 12 additions and 2 deletions

View File

@@ -1433,7 +1433,13 @@ namespace CSJ2K.j2k.codestream.reader
ccb.ntp[l] = 0;
ccb.pktIdx[l] = - 1;
}
throw new System.IO.EndOfStreamException();
// JH: If we try and seek past the end of the stream just stop the decoding
curOff = ehs.length() - 1;
ehs.seek(curOff);
stopRead = true;
return true;
//throw new System.IO.EndOfStreamException();
}
// If truncation mode