[FFmpeg-devel] [PATCH 08/13] lavfi/vf_vidstabtransform: check fclose return value

Ganesh Ajjanagadde gajjanagadde at gmail.com
Tue Jan 12 05:25:10 CET 2016


Maybe theoretical; since the file is opened in read-only mode.
Nevertheless, it is a good idea to check the return value.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
---
 libavfilter/vf_vidstabtransform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_vidstabtransform.c b/libavfilter/vf_vidstabtransform.c
index dac0a2d..12cf56c 100644
--- a/libavfilter/vf_vidstabtransform.c
+++ b/libavfilter/vf_vidstabtransform.c
@@ -228,7 +228,9 @@ static int config_input(AVFilterLink *inlink)
             }
         }
     }
-    fclose(f);
+    if (fclose(f))
+        av_log(ctx, AV_LOG_WARNING, "cannot close input file '%s': %s\n",
+               tc->input, av_err2str(AVERROR(errno)));
 
     if (vsPreprocessTransforms(td, &tc->trans) != VS_OK) {
         av_log(ctx, AV_LOG_ERROR, "error while preprocessing transforms\n");
-- 
2.7.0



More information about the ffmpeg-devel mailing list