From d84d0b7754224058b10906e1a191b1f21df9bc09 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 22 Jul 2018 21:15:28 +0200 Subject: [PATCH] Don't try to read empty timelines. --- server/TracyWorker.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 93228498..c15db716 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -470,13 +470,16 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) f.Read( td->count ); uint64_t tsz; f.Read( tsz ); - if( fileVer <= FileVersion( 0, 3, 2 ) ) + if( tsz != 0 ) { - ReadTimelinePre033( f, td->timeline, CompressThread( tid ), tsz, fileVer ); - } - else - { - ReadTimeline( f, td->timeline, CompressThread( tid ), tsz ); + if( fileVer <= FileVersion( 0, 3, 2 ) ) + { + ReadTimelinePre033( f, td->timeline, CompressThread( tid ), tsz, fileVer ); + } + else + { + ReadTimeline( f, td->timeline, CompressThread( tid ), tsz ); + } } uint64_t msz; f.Read( msz ); @@ -528,14 +531,20 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) ctx->period = 1.f; uint64_t tsz; f.Read( tsz ); - ReadTimelinePre032( f, ctx->timeline, tsz ); + if( tsz != 0 ) + { + ReadTimelinePre032( f, ctx->timeline, tsz ); + } } else { f.Read( ctx->period ); uint64_t tsz; f.Read( tsz ); - ReadTimeline( f, ctx->timeline, tsz ); + if( tsz != 0 ) + { + ReadTimeline( f, ctx->timeline, tsz ); + } } m_data.gpuData.push_back_no_space_check( ctx ); }