[MINC-users] Segfault in dcm2mnc on PET data from the Siemens mCT

Flemming Littrup Andersen fling at pet.rh.dk
Mon Jan 24 07:57:48 EST 2011


We have been using dcm2mnc for many years to convert our Siemens PET
images to Minc. dcm2mnc is now failing with segfault after a scanner
upgrade to Siemens newest PET scanner, the mCT PET/CT with TOF. This
is the case both for minc 2.0 and 2.1.

We have tried to localize the error - dcm2mnc is failing on a private
tag (0029,1010) not present in older Siemens implementations (VR is OB
accordint to Siemens Conformance statement) and we get the following:


Using dcm2mnc on the new Siemens PET images results in a segmentation
fault occuring at
line 487 in acr_io.c:

485      ptr1 = (char *) input_value;
485      ptr2 = (char *) mach_value;
486      for (i=0; i<nvals*value_size; i++) {
487         ptr2[i] = ptr1[i];
488      }

The problem occurs in the acr_parse_siemens_proto2 call after having obtained
a non-null element in dicom_to_minc.c, line 886:

886    element = acr_find_group_element(group_list, SPI_Protocol2);
887    if (element != NULL) {
888        group_list = parse_siemens_proto2(group_list, element);
889    }

acr_find_group_element(group_list, SPI_Protocol2) finds the
(group,element) pair
corresponding to SPI_Protocol2 (0029,1010) (see spi_element_defs.h). It returns
an Acr_element if it exists and NULL if it does not.


The segmentation fault occurs in the call to

  acr_get_long(ACR_LITTLE_ENDIAN, 1, byte_ptr + byte_pos, &len);

in dicom_to_minc.c:803 during the second iteration of the loop.
The update in line 813

813     byte_pos += ((len + 3) / 4) * 4;

causes byte_pos to become very large (overflow?), which may be the
source of the segfault.


A quick fix is to delete the tag (0029,1010) using standard dicom
tools or f.eks Osirix, Uncommenting of the parse_siemens_proto code
will also work.
Any suggestens is welcome, I will be happy to test and can also
provide testdata to anyone interested into looking into this.

Best regards,
Flemming

-- 
Flemming Littrup Andersen, Ph.D
Rigshospitalet Copenhagen, Dep. PET-3982
Phone: +45 3545-8143
Mobile: +45 2615-7368


More information about the MINC-users mailing list