dcmjs 0.29.0 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/dcmjs.es.js CHANGED
@@ -7509,9 +7509,7 @@ function toInt(val) {
7509
7509
  }
7510
7510
 
7511
7511
  function toFloat(val) {
7512
- if (isNaN(val)) {
7513
- throw new Error("Not a number: " + val);
7514
- } else if (typeof val == "string") {
7512
+ if (typeof val == "string") {
7515
7513
  return parseFloat(val);
7516
7514
  } else return val;
7517
7515
  }
@@ -10303,9 +10301,13 @@ var DicomMessage = /*#__PURE__*/function () {
10303
10301
  throw new Error("Invalid DICOM file, expected header is missing");
10304
10302
  }
10305
10303
 
10306
- var el = DicomMessage._readTag(stream, useSyntax),
10307
- metaLength = el.values[0]; //read header buffer
10304
+ var el = DicomMessage._readTag(stream, useSyntax);
10305
+
10306
+ if (el.tag.toCleanString() !== "00020000") {
10307
+ throw new Error("Invalid DICOM file, meta length tag is malformed or not present.");
10308
+ }
10308
10309
 
10310
+ var metaLength = el.values[0]; //read header buffer
10309
10311
 
10310
10312
  var metaStream = stream.more(metaLength);
10311
10313