Skip to content

Commit

Permalink
Don't leak frame references
Browse files Browse the repository at this point in the history
  • Loading branch information
myrsloik committed Dec 28, 2017
1 parent 40a737b commit 30660fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dotkill1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ typedef struct {
} DotKillData;

template<typename T>
static T clamp(T v, T lower, T upper) {
return std::max(std::min(v, upper), lower);
static T clamp(T v, T x, T y) {
return std::max(std::min(x, y), v);
}

static void VS_CC dotKillInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) {
Expand Down Expand Up @@ -124,6 +124,7 @@ static const VSFrameRef *VS_CC dotKillGetFrame(int n, int activationReason, void

int err = 0;
int64_t match = vsapi->propGetInt(vsapi->getFramePropsRO(inframe), "VFMMatch", 0, &err);
vsapi->freeFrame(inframe);
bool isC = (d->ignoreMatch || err || match == 1);

int width = d->vi->width;
Expand Down

0 comments on commit 30660fe

Please sign in to comment.