Don't read off end of capture if CaptureEnd chunk is missing

This commit is contained in:
baldurk
2020-05-29 17:49:57 +01:00
parent a8f6108444
commit e472536c5a
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1290,7 +1290,7 @@ ReplayStatus WrappedID3D11DeviceContext::ReplayLog(CaptureState readType, uint32
LoadProgress::FrameEventsRead,
float(m_CurChunkOffset - startOffset) / float(ser.GetReader()->GetSize()));
if((SystemChunk)chunktype == SystemChunk::CaptureEnd)
if((SystemChunk)chunktype == SystemChunk::CaptureEnd || ser.GetReader()->AtEnd())
break;
m_LastChunk = chunktype;
+1 -1
View File
@@ -945,7 +945,7 @@ ReplayStatus WrappedID3D12CommandQueue::ReplayLog(CaptureState readType, uint32_
LoadProgress::FrameEventsRead,
float(m_Cmd.m_CurChunkOffset - startOffset) / float(ser.GetReader()->GetSize()));
if((SystemChunk)context == SystemChunk::CaptureEnd)
if((SystemChunk)context == SystemChunk::CaptureEnd || ser.GetReader()->AtEnd())
break;
// break out if we were only executing one event
+1 -1
View File
@@ -5113,7 +5113,7 @@ ReplayStatus WrappedOpenGL::ContextReplayLog(CaptureState readType, uint32_t sta
LoadProgress::FrameEventsRead,
float(m_CurChunkOffset - startOffset) / float(ser.GetReader()->GetSize()));
if((SystemChunk)chunktype == SystemChunk::CaptureEnd)
if((SystemChunk)chunktype == SystemChunk::CaptureEnd || ser.GetReader()->AtEnd())
break;
m_LastChunk = chunktype;
+1 -1
View File
@@ -2492,7 +2492,7 @@ ReplayStatus WrappedVulkan::ContextReplayLog(CaptureState readType, uint32_t sta
LoadProgress::FrameEventsRead,
float(m_CurChunkOffset - startOffset) / float(ser.GetReader()->GetSize()));
if((SystemChunk)chunktype == SystemChunk::CaptureEnd)
if((SystemChunk)chunktype == SystemChunk::CaptureEnd || ser.GetReader()->AtEnd())
break;
// break out if we were only executing one event