Merge changes Ie4318152,I1e65f30f

* changes:
  Block::Parse: use int64 to aggregate laced frame sizes
  UnserializeFloat: check result for Inf/NaN
This commit is contained in:
James Zern
2015-08-25 06:25:04 +00:00
committed by Gerrit Code Review

View File

@@ -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;
} }
@@ -7373,7 +7377,7 @@ long Block::Parse(const Cluster* pCluster) {
Frame* pf = m_frames; Frame* pf = m_frames;
Frame* const pf_end = pf + m_frame_count; Frame* const pf_end = pf + m_frame_count;
long size = 0; long long size = 0;
int frame_count = m_frame_count; int frame_count = m_frame_count;
while (frame_count > 1) { while (frame_count > 1) {
@@ -7496,7 +7500,7 @@ long Block::Parse(const Cluster* pCluster) {
if (pos >= stop) if (pos >= stop)
return E_FILE_FORMAT_INVALID; return E_FILE_FORMAT_INVALID;
long size = 0; long long size = 0;
int frame_count = m_frame_count; int frame_count = m_frame_count;
long long frame_size = ReadUInt(pReader, pos, len); long long frame_size = ReadUInt(pReader, pos, len);