[FFmpeg-devel] [PATCH 05/13] lavfi/vf_psnr: check fclose return value

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


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

diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index bce5c51..b6e7f06 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -339,7 +339,10 @@ static av_cold void uninit(AVFilterContext *ctx)
     ff_dualinput_uninit(&s->dinput);
 
     if (s->stats_file && s->stats_file != stdout)
-        fclose(s->stats_file);
+        if (fclose(s->stats_file))
+            av_log(NULL, AV_LOG_ERROR,
+                   "Unable to close file '%s', loss of information possible: %s\n",
+                   s->stats_file_str, av_err2str(AVERROR(errno)));
 }
 
 static const AVFilterPad psnr_inputs[] = {
-- 
2.7.0



More information about the ffmpeg-devel mailing list