Skip to content

Commit

Permalink
Update tiny_gltf.h
Browse files Browse the repository at this point in the history
Removed `#undef` 
and used the @syoyo method:

#467 (comment)
  • Loading branch information
rhiskey authored Dec 4, 2023
1 parent 03b3a31 commit 8acf861
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tiny_gltf.h
Original file line number Diff line number Diff line change
Expand Up @@ -6669,8 +6669,7 @@ bool TinyGLTF::LoadBinaryFromMemory(Model *model, std::string *err,
// Use 64bit uint to avoid integer overflow.
uint64_t header_and_json_size = 20ull + uint64_t(chunk0_length);

#undef max
if (header_and_json_size > std::numeric_limits<uint32_t>::max()) {
if (header_and_json_size > (std::numeric_limits<uint32_t>::max)()) {
// Do not allow 4GB or more GLB data.
if (err) {
(*err) = "Invalid glTF binary. GLB data exceeds 4GB.";
Expand Down

0 comments on commit 8acf861

Please sign in to comment.