[Gdcm-hackers] [ gdcm-Bugs-3414704 ] JPEG2000Codec::GetHeaderInfo crash, NULL deref, 2.0.18
Cross-platform DICOM implementation
Brought to you by:
malat
From: SourceForge.net <no...@so...> - 2011-09-27 20:55:53
|
Bugs item #3414704, was opened at 2011-09-27 16:55 Message generated for change (Tracker Item Submitted) made by sean_mcbride You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=739587&aid=3414704&group_id=137895 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General (default) Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Sean McBride (sean_mcbride) Assigned to: Mathieu Malaterre (malat) Summary: JPEG2000Codec::GetHeaderInfo crash, NULL deref, 2.0.18 Initial Comment: My app uses GDCM 2.0.18 via ITK. It is crashing trying to open 3E768EB7.dcm from the gdcm test data. Backtrace: #0 0x1018041cc in gdcm::JPEG2000Codec::GetHeaderInfo at gdcmJPEG2000Codec.cxx:1226 #1 0x10177d6e4 in gdcm::Bitmap::TryJPEG2000Codec at gdcmBitmap.cxx:666 #2 0x10177fd8f in gdcm::Bitmap::GetBufferInternal at gdcmBitmap.cxx:839 #3 0x10177fe2e in gdcm::Bitmap::ComputeLossyFlag at gdcmBitmap.cxx:643 #4 0x1017ad460 in gdcm::PixmapReader::ReadImage at gdcmPixmapReader.cxx:1044 #5 0x1017b1d0b in gdcm::ImageReader::ReadImage at gdcmImageReader.cxx:59 #6 0x1017ad785 in gdcm::PixmapReader::Read at gdcmPixmapReader.cxx:90 #7 0x1017b1991 in gdcm::ImageReader::Read at gdcmImageReader.cxx:54 #8 0x101794ea6 in gdcm::SerieHelper::AddFileName at gdcmSerieHelper.cxx:139 #9 0x10179516d in gdcm::SerieHelper::SetDirectory at gdcmSerieHelper.cxx:130 #10 0x1007593d8 in itk::GDCMSeriesFileNames::SetInputDirectory at itkGDCMSeriesFileNames.cxx:80 #11 0x100466aed in itk::GDCMSeriesFileNames::SetDirectory at itkGDCMSeriesFileNames.h:76 The responsible code is: case J2K_CFMT: j2k = (opj_j2k_t*)dinfo->j2k_handle; assert( j2k ); reversible = j2k->cp->tcps->tccps->qmfbid; The problem is that 'cp' is NULL. I guess some extra NULL checks are needed! :) This repros when 3E768EB7.dcm is in the same folder as all the other files, but does not repro if it is in a folder alone. I guess this is because SetDirectory() is examining all the other DICOM files in the folder. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=739587&aid=3414704&group_id=137895 |