Skip to content

Commit 03b3a31

Browse files
authored
Update tiny_gltf.h
Fixed `Windows.h` MINMAX error and reverted to original numeric limits of type `uint32_t`
1 parent 30ec815 commit 03b3a31

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tiny_gltf.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -6669,7 +6669,8 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
66696669
// Use 64bit uint to avoid integer overflow.
66706670
uint64_t header_and_json_size = 20ull + uint64_t(chunk0_length);
66716671

6672-
if (header_and_json_size > sizeof(uint64_t)) {
6672+
#undef max
6673+
if (header_and_json_size > std::numeric_limits<uint32_t>::max()) {
66736674
// Do not allow 4GB or more GLB data.
66746675
if (err) {
66756676
(*err) = "Invalid glTF binary. GLB data exceeds 4GB.";

0 commit comments

Comments
 (0)