avfilter: Free out on error

CID1197065 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 10 months ago
parent 348968e9f7
commit a7f5845a6c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 6
      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); 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 deshake->sad = av_pixelutils_get_sad_fn(4, 4, aligned, deshake); // 16x16, 2nd source unaligned
if (!deshake->sad) if (!deshake->sad) {
return AVERROR(EINVAL); ret = AVERROR(EINVAL);
goto fail;
}
if (deshake->cx < 0 || deshake->cy < 0 || deshake->cw < 0 || deshake->ch < 0) { if (deshake->cx < 0 || deshake->cy < 0 || deshake->cw < 0 || deshake->ch < 0) {
// Find the most likely global motion for the current frame // Find the most likely global motion for the current frame

Loading…
Cancel
Save