diff --git a/tinygltf_json.h b/tinygltf_json.h index c33f22f..f940681 100644 --- a/tinygltf_json.h +++ b/tinygltf_json.h @@ -308,7 +308,8 @@ static const char *cj_scan_str(const char *p, const char *end) { * Breaks strict JSON/IEEE-754-double conformance. * ====================================================================== */ -/* Safe double-to-int64 cast: clamp inf/NaN/out-of-range to 0. */ +/* Safe double-to-int64 cast: returns 0 for NaN; clamps +inf/out-of-range-high + * to INT64_MAX and -inf/out-of-range-low to INT64_MIN. */ static int64_t cj_dbl_to_i64(double d) { if (d != d) return 0; /* NaN */ if (d >= (double)INT64_MAX) return INT64_MAX; diff --git a/tmp.glb b/tmp.glb new file mode 100644 index 0000000..3042f8b Binary files /dev/null and b/tmp.glb differ