NOTICE! This is a static HTML version of a legacy LOCI Software ticket.

LOCI projects are now located on GitHub. The Bio-Formats project can be found here.

Ticket #415 (closed defect: fixed)

Opened 2009-09-28T19:05:41-05:00

Last modified 2009-10-12T10:53:09-05:00

Lossless JPEG codec performs invalid bit operations

Reported by: curtis Owned by: melissa
Priority: major Milestone: bio-formats-4.1
Component: bio-formats Severity: major
Keywords: Cc: Mack.Gardner-Morse@…
Blocked By: Blocking:

Description

Sometimes the lossless JPEG codec attempts to extract a negative number of bits from a data stream, which the bit buffer engine does not support. E.g.:

curtis@monk:~/data/dicom/mack$ showinf IM-0001-0068.dcm -nocore -nometa
Checking file format [DICOM]
Initializing reader
	Verifying DICOM format
	Reading tags
	Calculating image offsets
	Building file list
	Populating metadata
Initialization took 0.461s

Reading pixel data (0-0) Exception in thread "main" java.lang.IllegalArgumentException: Bits to read may not be negative
	at loci.formats.codec.BitBuffer.getBits(BitBuffer.java:125)
	at loci.formats.codec.HuffmanCodec.getSample(HuffmanCodec.java:110)
	at loci.formats.codec.LosslessJPEGCodec.decompress(LosslessJPEGCodec.java:172)
	at loci.formats.codec.JPEGCodec.decompress(JPEGCodec.java:109)
	at loci.formats.codec.BaseCodec.decompress(BaseCodec.java:165)
	at loci.formats.in.DicomReader.openBytes(DicomReader.java:315)
	at loci.formats.FormatReader.openBytes(FormatReader.java:604)
	at loci.formats.ImageReader.openBytes(ImageReader.java:325)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:261)
	at loci.formats.gui.BufferedImageReader.openImage(BufferedImageReader.java:74)
	at loci.formats.tools.ImageInfo.readPixels(ImageInfo.java:639)
	at loci.formats.tools.ImageInfo.testRead(ImageInfo.java:821)
	at loci.formats.tools.ImageInfo.main(ImageInfo.java:838)

Change History

comment:1 Changed 2009-10-12T10:53:09-05:00 by melissa

  • Status changed from new to closed
  • Resolution set to fixed

(In [5580]) Fixed bit reading problem in Huffman codec. Closes #415.