mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-22 19:50:05 +00:00
Avoid uninitialised read when parsing hex float (#4646)
Ensures that when an attempt to read a floating-point value from an input stream fails, the recieving variable for the read does not end up uninitialised. Fixes OSS-Fuzz:40432 Fixes #4644
This commit is contained in:
parent
f9bcc82ec7
commit
1f3f0f185b
@ -199,7 +199,7 @@ bool operator==(const FloatProxy<T>& first, const FloatProxy<T>& second) {
|
||||
// Reads a FloatProxy value as a normal float from a stream.
|
||||
template <typename T>
|
||||
std::istream& operator>>(std::istream& is, FloatProxy<T>& value) {
|
||||
T float_val;
|
||||
T float_val = static_cast<T>(0.0);
|
||||
is >> float_val;
|
||||
value = FloatProxy<T>(float_val);
|
||||
return is;
|
||||
|
Loading…
Reference in New Issue
Block a user