Re: [FFmpeg-devel] [PATCH] ffmpeg_opt: check fclose return value
On Mon, Jan 11, 2016 at 05:35:17PM -0500, Ganesh Ajjanagadde wrote: > 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> --- > ffmpeg_opt.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) probably ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No great genius has ever existed without some touch of madness. -- Aristotle signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffmpeg_opt: check fclose return value
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--- 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