[magick-developers] DICOM bug

glennrp at comcast.net glennrp at comcast.net
Mon Mar 9 19:28:33 UTC 2009


----- Original Message -----
From: jcupitt at gmail.com
To: magick-developers at imagemagick.org
Sent: Monday, March 9, 2009 2:07:09 PM GMT -05:00 US/Canada Eastern
Subject: [magick-developers] DICOM bug

Hi,.

I think I've found a bug in the DICOM reader. In the current 6.4.9-8,
coders/dcm.c has in sketch form:

  unsigned long
    index,
  ...
  index=ReadBlobLSBShort(image)

then at line 3487:

        if (signed_data == 1)
          index-=32767;

     I haven't reviewed the code, but it looks as though the intent is
     to do the subtraction mod 2^16, so

        if (signed_data == 1)
          index = ((long)index - 32767) & 0xffff);

Glenn


More information about the Magick-developers mailing list