Crash with gdcm::Reader on a jpeg and try to Read twic
Cross-platform DICOM implementation
Brought to you by:
malat
My problem is if i try to read for instance a jpeg file with a
gdcm::Reader().
if i try this code :
gdcm::Reader reader ;
reader.SetFileName( "c:\\toto.jpg" );
reader.Read();
readre.Read();
the program will crash ( not in gdcm v2.0.15 )
I identify the problem :
in gdcm v2.0.15 we close and set the Stream to NULL :
Ifstream->close();
delete Ifstream;
Ifstream = NULL;
Stream = NULL;
in gdcmv2.2.0 we do not set stream to NULL but we clear it so when we try a
second time to read it ( in preamble it crashes ).
I could handle it my solution would be to add a member tryOnceToReadFile (boolean ) and to set by default to false. The first time we try to read it will set to true. The gdcm::Reader will be one shot exept if we set tryOnceToReadFile to false each time we specify a new Filename/stream
wrote .git/COMMIT_EDITMSG, 86 lines, 3114 chars
[master ef774bc] Add a test to reproduce issue #3538586
2 files changed, 52 insertions(+), 0 deletions(-)
create mode 100644 Testing/Source/DataStructureAndEncodingDefinition/Cxx/TestReader4.cxx