summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>2016-01-06 20:57:47 -0800
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>2016-01-07 16:57:37 -0800
commit7ab37cae34b3845de7b689d167661bb4a5c2ab5b (patch)
tree0b5992e62b34caec5a24587ea077eecce09eab8b /ffmpeg.c
parent2fbdc4faf1bc0740cf18b0267c017e2afafaa99e (diff)
ffmpeg: check fclose return values
In the spirit of commit a956840cbc. Simple method to reproduce: pass -vstats_file /dev/full to ffmpeg. All raw fclose usages in ffmpeg.c taken care of here. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 659bd7f3c1..86a0960242 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -554,8 +554,12 @@ static void ffmpeg_cleanup(int ret)
av_freep(&input_streams[i]);
}
- if (vstats_file)
- fclose(vstats_file);
+ if (vstats_file) {
+ if (fclose(vstats_file))
+ av_log(NULL, AV_LOG_ERROR,
+ "Error closing vstats file, loss of information possible: %s\n",
+ av_err2str(AVERROR(errno)));
+ }
av_freep(&vstats_filename);
av_freep(&input_streams);
@@ -4200,7 +4204,10 @@ static int transcode(void)
ost = output_streams[i];
if (ost) {
if (ost->logfile) {
- fclose(ost->logfile);
+ if (fclose(ost->logfile))
+ av_log(NULL, AV_LOG_ERROR,
+ "Error closing logfile, loss of information possible: %s\n",
+ av_err2str(AVERROR(errno)));
ost->logfile = NULL;
}
av_freep(&ost->forced_kf_pts);