UnserializeFloat: check result for Inf/NaN
fail in either case BUG=23488728 Change-Id: I1e65f30ff1cf857a5d1eb4bdedc3f842423cf15f
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <new>
|
#include <new>
|
||||||
#include <climits>
|
#include <climits>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
// Disable MSVC warnings that suggest making code non-portable.
|
// Disable MSVC warnings that suggest making code non-portable.
|
||||||
@@ -206,6 +207,9 @@ long mkvparser::UnserializeFloat(IMkvReader* pReader, long long pos,
|
|||||||
result = d;
|
result = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (std::isinf(result) || std::isnan(result))
|
||||||
|
return E_FILE_FORMAT_INVALID;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user