From 7e1212252c64a96955a42a4efcf1b91ab07587f1 Mon Sep 17 00:00:00 2001 From: Magnus Lundborg Date: Mon, 11 Aug 2014 10:48:37 +0200 Subject: 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 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); } -- cgit v0.10.1