Re: [Gdcm2] Buffer problem in Qt environment
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Sylvain A. <syl...@ho...> - 2009-06-17 14:54:07
|
Well I made it crash with a BMP file. It obvisously does crash. But this message, which is the issue: ----------------------------------------- HEAP[MyProgram.exe]: Invalid Address specified to RtlFreeHeap( 05080000, 04DAA558 ) ----------------------------------------- does appear even before the program is started during the debugging and does not appear anymore when you avoid setting the buffer. Anyway, don't concern yourself too much, it doesn't look that critical. It might not even be a major problem as the program works perfectly. This specific error seems to be issued while trying to free some memory. Yet, I'm not freeing any memory in my program, the class deals with it by itself! AND, as I said earlier, the compiler issue the error even BEFORE the program is started. It might come from my debugger rationale as well. Btw, as I can't access the wiki page for now from where am I, I can't see the ConvertToQImage.cxx you uploaded ! I'll check this out tonight. But regarding the code I gave you, everything is fine. Sylvain > Date: Wed, 17 Jun 2009 16:31:50 +0200 > Subject: Re: [Gdcm2] Buffer problem in Qt environment > From: mat...@gm... > To: syl...@ho... > CC: mm...@gm...; gdc...@li... > > On Wed, Jun 17, 2009 at 4:26 PM, Sylvain ADAM<syl...@ho...> wrote: > > Yep, that's exactly why I've chosen to use the RGB 24 bits format in 8-8-8, > > which displays the image without losing too much information in 8-bits. > > > > As I didn't know before and I was passing the 16-bits buffer to a RGB16 > > format, this is why I had a weird blue-green image. > > To the best of my knowledge this is NOT a bug. The only reason why > this would happen is if the reader failed somehow but you would still > try to copy the buffer. Eg: > > ImageReader ir; > ir.SetFileName( ); > bool b = ir.Read() > > assert( b == false ); // programmer should not go any further when > imagereader fails > > Image& i = ir.GetImage(); > char *b = new char[ ir.GetBufferLength() ] > i.GetBuffer( b ) > > Use the code ConvertToQImage.cxx and try to make it crash, with any > sample dataset you have. If you do, send me that dataset (you can use > anything from gdcmData). > > 2cts > -- > Mathieu _________________________________________________________________ Téléphonez gratuitement à tous vos proches avec Windows Live Messenger ! Téléchargez-le maintenant ! http://www.windowslive.fr/messenger/1.asp |