Skip to content

Commit c2e0efe

Browse files
committed
vcompress: make vcomp_pop_retry placeholder const
To protect from accidental errors like overriding it with a different value, possibly also returning a reference to it and subsequent destruction.
1 parent a0f4776 commit c2e0efe

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/video_compress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ using namespace std;
7171
struct compress_state;
7272

7373
static video_frame pop_retry_frame{};
74-
shared_ptr<video_frame> vcomp_pop_retry(&pop_retry_frame, [](video_frame *){});
74+
const shared_ptr<video_frame> vcomp_pop_retry(&pop_retry_frame, [](video_frame *){});
7575

7676
namespace {
7777
/**

src/video_compress.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ std::shared_ptr<video_frame> compress_pop(struct compress_state *);
103103
#include <vector>
104104

105105
/// _pop callbacks can return to indicate recoverable error
106-
extern std::shared_ptr<video_frame> vcomp_pop_retry;
106+
extern const std::shared_ptr<video_frame> vcomp_pop_retry;
107107

108108
/**
109109
* @brief Initializes video compression

0 commit comments

Comments
 (0)