Skip to content

Commit 9c48f4b

Browse files
committed
safety check.
1 parent 68257fa commit 9c48f4b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/mdim.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ List CPL_read_mdim(CharacterVector file, CharacterVector array_names, CharacterV
355355
for (const auto &co: components) {
356356
auto t(co->GetType());
357357
if (t.GetClass() == GEDTC_NUMERIC) {
358+
if (t.GetSize() != sizeof(double))
359+
stop("only Float64 data supported in numeric compounds");
358360
NumericVector vec(nValues);
359361
for (int j = 0; j < nValues; j++)
360362
memcpy(&(vec[j]), v + j * sz + co->GetOffset(), sizeof(double));

0 commit comments

Comments
 (0)