Bug fix in CSJ2K to handle both binary and latin-15 comments (this one should probably be pushed upstream)

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3122 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
John Hurliman
2009-10-02 23:53:16 +00:00
parent 8869b9e344
commit d71bf4c6dd
2 changed files with 7 additions and 6 deletions

View File

@@ -865,16 +865,15 @@ namespace CSJ2K.j2k.codestream.reader
ms.rcom = ehs.ReadUInt16();
switch (ms.rcom)
{
case CSJ2K.j2k.codestream.Markers.RCOM_GEN_USE:
case CSJ2K.j2k.codestream.Markers.RCOM_BINARY:
case CSJ2K.j2k.codestream.Markers.RCOM_LATIN:
ms.ccom = new byte[ms.lcom - 4];
for (int i = 0; i < ms.lcom - 4; i++)
{
ms.ccom[i] = ehs.ReadByte();
}
break;
default:
default:
// --- Unknown or unsupported markers ---
// (skip them and see if we can get way with it)
FacilityManager.getMsgLogger().printmsg(CSJ2K.j2k.util.MsgLogger_Fields.WARNING, "COM marker registered as 0x" + System.Convert.ToString(ms.rcom, 16) + " unknown, ignoring (this might crash the " + "decoder or decode a quality degraded or even " + "useless image)");