Menu

#499 GDCM causes crashes when non-compliant JPEG2000 files are read.

3.0.6
closed
None
5
2020-06-25
2020-02-29
Todd Jensen
No

While researching how different applications handle non-compliant DICOM files using JPEG2000, I've come across a case that leads to crashes in applications using GDCM, most likely due to a buffer being allocated that is too small for the actual pixel data. I've attached an example image (JPEG2000 stream has 12-bit data, 16 bits stored, but DICOM meta-data has 8 as the bits stored).

I suggest in gdcm::Bitmap::TryJPEG2000Codec() the "if 0" statements be enabled (changed to "if 1"). I've tested this and it fixes the issue while still handling compliant images.

1 Attachments

Discussion

  • Mathieu Malaterre

    • assigned_to: Mathieu Malaterre
     
  • Mathieu Malaterre

    • Group: 3.1 --> 3.0.6
     
    👍
    1
  • Mathieu Malaterre

    No idea what I was trying to do in 37e11ebf90743ece6b932b66311d7ae0cedc8454

     
    😄
    1
  • Mathieu Malaterre

    Fixed in 03879d17959b59116cb08122bdb59ef127388d6b

     
  • Mathieu Malaterre

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB