aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-07 20:47:28 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-15 01:59:41 +0200
commita7f5845a6c1ac596b04baa96f9f59355d223dcad (patch)
treedf99296a63b0c65e16f268fa1356667ac8c50b81
parent348968e9f7d8abb743a5dfca8e522ae0cf1ddc8b (diff)
downloadffmpeg-a7f5845a6c1ac596b04baa96f9f59355d223dcad.tar.gz
avfilter: Free out on error
CID1197065 Resource leak Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavfilter/vf_deshake.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c
index 107b78a7d1..05a2df652e 100644
--- a/libavfilter/vf_deshake.c
+++ b/libavfilter/vf_deshake.c
@@ -478,8 +478,10 @@ static int filter_frame(AVFilterLink *link, AVFrame *in)
aligned = !((intptr_t)in->data[0] & 15 | in->linesize[0] & 15);
deshake->sad = av_pixelutils_get_sad_fn(4, 4, aligned, deshake); // 16x16, 2nd source unaligned
- if (!deshake->sad)
- return AVERROR(EINVAL);
+ if (!deshake->sad) {
+ ret = AVERROR(EINVAL);
+ goto fail;
+ }
if (deshake->cx < 0 || deshake->cy < 0 || deshake->cw < 0 || deshake->ch < 0) {
// Find the most likely global motion for the current frame