Commit 7ab37cae authored by Ganesh Ajjanagadde's avatar Ganesh Ajjanagadde

ffmpeg: check fclose return values

In the spirit of commit a956840c. Simple method to reproduce:
pass -vstats_file /dev/full to ffmpeg.

All raw fclose usages in ffmpeg.c taken care of here.
Reviewed-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarGanesh Ajjanagadde <gajjanagadde@gmail.com>
parent 2fbdc4fa
...@@ -554,8 +554,12 @@ static void ffmpeg_cleanup(int ret) ...@@ -554,8 +554,12 @@ static void ffmpeg_cleanup(int ret)
av_freep(&input_streams[i]); av_freep(&input_streams[i]);
} }
if (vstats_file) if (vstats_file) {
fclose(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(&vstats_filename);
av_freep(&input_streams); av_freep(&input_streams);
...@@ -4200,7 +4204,10 @@ static int transcode(void) ...@@ -4200,7 +4204,10 @@ static int transcode(void)
ost = output_streams[i]; ost = output_streams[i];
if (ost) { if (ost) {
if (ost->logfile) { 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; ost->logfile = NULL;
} }
av_freep(&ost->forced_kf_pts); av_freep(&ost->forced_kf_pts);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment