mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Don't read off end of capture if CaptureEnd chunk is missing
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user