summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2014-08-11 08:48:37 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2014-08-11 08:48:37 (GMT)
commit7e1212252c64a96955a42a4efcf1b91ab07587f1 (patch)
tree8a5bd8a041e6b2c60e751b76a18c48a50c50618a /src
parent1a09f345860834fb1c2005e65948fa296b201e8b (diff)
Check that the data type is float as expected.
Some of the utility functions read data of a certain type. Checks are added to ensure the data type of the block is float if using a function to read float data. Change-Id: I1ae6ced70545388c8d1a38f13f62fd773fd65d22
Diffstat (limited to 'src')
-rw-r--r--src/lib/tng_io.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 6e0f915..caa1445 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -17636,6 +17636,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_pos_read_range
&n_values_per_frame,
&type);
+ if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+ {
+ return(TNG_FAILURE);
+ }
+
return(stat);
}
@@ -17664,6 +17669,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_vel_read_range
&n_values_per_frame,
&type);
+ if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+ {
+ return(TNG_FAILURE);
+ }
+
return(stat);
}
@@ -17692,6 +17702,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_force_read_range
&n_values_per_frame,
&type);
+ if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+ {
+ return(TNG_FAILURE);
+ }
+
return(stat);
}
@@ -17719,6 +17734,11 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read_range
&n_values_per_frame,
&type);
+ if(stat == TNG_SUCCESS && type != TNG_FLOAT_DATA)
+ {
+ return(TNG_FAILURE);
+ }
+
return(stat);
}
contact: Jan Huwald // Impressum