Skip to content

Commit

Permalink
Merge pull request ddnet#9367 from Robyt3/Demo-Extract-Stack-Overflow…
Browse files Browse the repository at this point in the history
…-Fix

Fix stack-overflow in `demo_extract_chat` tool
  • Loading branch information
def- authored Dec 9, 2024
2 parents cfefe25 + 6002f0f commit fd34043
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tools/demo_extract_chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <game/gamecore.h>

#include <memory>

static const char *TOOL_NAME = "demo_extract_chat";

class CClientSnapshotHandler
Expand Down Expand Up @@ -195,8 +197,8 @@ class CDemoPlayerMessageListener : public CDemoPlayer::IListener

static int ExtractDemoChat(const char *pDemoFilePath, IStorage *pStorage)
{
CSnapshotDelta DemoSnapshotDelta;
CDemoPlayer DemoPlayer(&DemoSnapshotDelta, false);
std::unique_ptr<CSnapshotDelta> pDemoSnapshotDelta = std::make_unique<CSnapshotDelta>();
CDemoPlayer DemoPlayer(pDemoSnapshotDelta.get(), false);

if(DemoPlayer.Load(pStorage, nullptr, pDemoFilePath, IStorage::TYPE_ALL_OR_ABSOLUTE) == -1)
{
Expand Down

0 comments on commit fd34043

Please sign in to comment.