Skip to content

Commit 53121a3

Browse files
committed
Fix undefined behavior for ReadColor
1 parent 80fe718 commit 53121a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Shared/sdk/CScriptArgReader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ class CScriptArgReader
479479
ReadNumber(color);
480480

481481
if (!m_bError)
482-
outValue = static_cast<unsigned int>(color);
482+
outValue = static_cast<unsigned long>(static_cast<int64_t>(color));
483483
}
484484

485485
//
@@ -491,7 +491,7 @@ class CScriptArgReader
491491
ReadNumber(color, static_cast<lua_Number>(defaultValue));
492492

493493
if (!m_bError)
494-
outValue = static_cast<unsigned int>(color);
494+
outValue = static_cast<unsigned long>(static_cast<int64_t>(color));
495495
}
496496

497497
//

0 commit comments

Comments
 (0)