Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dicom: SkipBytes Exception #3509

Open
dgault opened this issue Feb 11, 2020 · 1 comment
Open

Dicom: SkipBytes Exception #3509

dgault opened this issue Feb 11, 2020 · 1 comment

Comments

@dgault
Copy link
Member

dgault commented Feb 11, 2020

Issue was discovered in submitted QA files:
QA-29062
QA-29063
QA-29064
QA-29065

Files were tested using Bio-Formats 6.3.1 and the following exception was seen when attempting to read the files:

java.lang.IllegalArgumentException
	at java.nio.Buffer.position(Buffer.java:244)
	at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:650)
	at loci.common.NIOFileHandle.skipBytes(NIOFileHandle.java:494)
	at loci.common.NIOFileHandle.skipBytes(NIOFileHandle.java:482)
	at loci.common.RandomAccessInputStream.skipBytes(RandomAccessInputStream.java:670)
	at loci.formats.in.DicomReader.addFileToList(DicomReader.java:1411)
	at loci.formats.in.DicomReader.scanDirectory(DicomReader.java:1354)
	at loci.formats.in.DicomReader.makeFileList(DicomReader.java:1303)
	at loci.formats.in.DicomReader.initFile(DicomReader.java:799)
	at loci.formats.FormatReader.setId(FormatReader.java:1389)

The line it is failing on is stream.skipBytes(elementLength); for tag 0

@melissalinkert
Copy link
Member

Confirmed that these datasets still have problems with 6.8.0. Files in the same directory are not grouped together, and pixel data is unreadable (possibly due to 12-bit JPEG?):

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: arraycopy: last source index 1024 out of bounds for byte[0]
	at java.base/java.lang.System.arraycopy(Native Method)
	at loci.formats.in.DicomReader.getTile(DicomReader.java:1594)
	at loci.formats.in.DicomReader.openBytes(DicomReader.java:300)
	at loci.formats.FormatReader.openBytes(FormatReader.java:919)
	at loci.formats.ImageReader.openBytes(ImageReader.java:449)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.formats.gui.BufferedImageReader.openImage(BufferedImageReader.java:86)
	at loci.formats.tools.ImageInfo.readPixels(ImageInfo.java:821)
	at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:1055)
	at loci.formats.tools.ImageInfo.main(ImageInfo.java:1121)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants