/*
*
- * Copyright (C) 2011-2023, OFFIS e.V.
+ * Copyright (C) 2011-2026, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were slightly modified by
if (f==NULL) { if (pResults) pResults->error=eXMLErrorFileNotFound; return emptyXMLNode; }
fseek(f,0,SEEK_END);
int l=OFstatic_cast(int, ftell(f)),headerSz=0;
- if (!l) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
+ // DCMTK: handle situation where ftell() returns -1
+ if (l <= 0) { if (pResults) pResults->error=eXMLErrorEmpty; fclose(f); return emptyXMLNode; }
fseek(f,0,SEEK_SET);
unsigned char *buf=OFreinterpret_cast(unsigned char*, malloc(l+4));
l=OFstatic_cast(int, fread(buf,1,l,f));