From 30660feabef28f9ebd8e11915e24d50f331bb58c Mon Sep 17 00:00:00 2001 From: Fredrik Mellbin Date: Thu, 28 Dec 2017 20:31:07 +0100 Subject: [PATCH] Don't leak frame references --- dotkill1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dotkill1.cpp b/dotkill1.cpp index 82400a1..6d686de 100644 --- a/dotkill1.cpp +++ b/dotkill1.cpp @@ -11,8 +11,8 @@ typedef struct { } DotKillData; template -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) { @@ -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;