Skip to content

Commit c9932b6

Browse files
committed
Fix memory leaks on VapourSynth
1 parent 57dcdc2 commit c9932b6

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

delogohd_filter.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class DelogoHDFilter: public Interface {
6464
engine->template processImage<uint16_t>(dst->GetWritePtr(PLANAR_V), this->stride(dst, PLANAR_V), this->width(dst, PLANAR_V), this->height(dst, PLANAR_V), 2, opacity);
6565

6666
}
67+
this->FreeFrame(src);
6768

6869
return dst;
6970
}

wrapper/avs_filter.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class AVSFilter : public IClip {
4848
_env->MakeWritable(&frame);
4949
return frame;
5050
}
51+
52+
void FreeFrame(const PVideoFrame frame) { }
5153
int ssw() const { return vi.GetPlaneWidthSubsampling(PLANAR_U); }
5254
int ssh() const { return vi.GetPlaneHeightSubsampling(PLANAR_U); }
5355

wrapper/vs_filter.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ class VSFilter {
147147
AFrame* Dup(AFrame* frame) {
148148
return frame->dup();
149149
}
150+
151+
void FreeFrame(AFrame* frame) {
152+
_vsapi->freeFrame(frame->_frame);
153+
}
150154
int ssw() const { return vi._vi.format->subSamplingW; }
151155
int ssh() const { return vi._vi.format->subSamplingH; }
152156

0 commit comments

Comments
 (0)