aports/testing/gdcm/70-fix-readintobuffer-assert.patch
2026-04-15 17:10:38 +00:00

19 lines
641 B
Diff

diff --git a/Utilities/VTK/vtkGDCMImageReader2.cxx b/Utilities/VTK/vtkGDCMImageReader2.cxx
index 4976f0190..db0fa4d30 100644
--- a/Utilities/VTK/vtkGDCMImageReader2.cxx
+++ b/Utilities/VTK/vtkGDCMImageReader2.cxx
@@ -891,7 +891,12 @@ int vtkGDCMImageReader2::LoadSingleFile(const char *filename, char *pointer, uns
char * copy = new char[len];
/*image.GetBuffer(copy);*/
bool b = reader.ReadIntoBuffer(copy, len);
- assert( b );
+ if( !b )
+ {
+ delete[] copy;
+ vtkErrorMacro( "Could not ReadIntoBuffer" );
+ return 0;
+ }
if( !r.Rescale(pointer,copy,len) )
{
delete[] copy;