This one may be slightly more theoretical, since the preset file is opened in a
read-only mode. Nevertheless, it is a good idea to check its return value.

Signed-off-by: Ganesh Ajjanagadde <gajjanaga...@gmail.com>
---
 ffmpeg_opt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 9b341cf..13786da 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -2724,7 +2724,10 @@ static int opt_preset(void *optctx, const char *opt, 
const char *arg)
         }
     }
 
-    fclose(f);
+    if (fclose(f))
+        av_log(NULL, AV_LOG_ERROR,
+               "Error closing preset file: %s\n",
+               av_err2str(AVERROR(errno)));
 
     return 0;
 }
-- 
2.7.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to