avfilter/vf_vidstabtransform: close the transforms file on parse failure

Found-by: zhang xingxing
Fixes: FILE leak
Fixes: iXnhUsbrxJo8
Fixes: swarm-File-descriptor-leak-on-transform-file-parse-failure-4e8d03
This commit is contained in:
zhang xingxing authored and michaelni committed 2026-10-11 00:44:16 +00:00
1 parent 87941e8765
commit bb4b95c68f
1 file changed
+2
+2
View File
@@ -204,11 +204,13 @@ static int config_input(AVFilterLink *inlink)
// calculate the actual transforms from the local motions
if (vsLocalmotions2Transforms(td, &mlms, &tc->trans) != VS_OK) {
av_log(ctx, AV_LOG_ERROR, "calculating transformations failed\n");
fclose(f);
return AVERROR(EINVAL);
}
} else { // try to read old format
if (!vsReadOldTransforms(td, f, &tc->trans)) { /* read input file */
av_log(ctx, AV_LOG_ERROR, "error parsing input file %s\n", tc->input);
fclose(f);
return AVERROR(EINVAL);
}
}