[FFmpeg-devel] [PATCH 00/13] check all fclose usage

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

Some preliminary work has already been done on fclose checking. This completes
the work, modulo a few exceptions:
1. Things under an ifdef DEBUG or similar: these are not important.
2. Tests/tools code: also not important.
3. Likely not important, and beyond my knowledge: see lavu/arm/cpu.c. fclose is
done on read-only files, see get_cpuinfo, get_hwcap. Thus,
the importance of checking the return value is relatively little. Furthermore, /proc/cpuinfo is a method
that only works on Linux, on BSD's sysctl or other method must be used:
Thus, a proper, portable solution may bypass fclose altogether.

Note that the choice of error level, e.g WARNING vs ERROR is subjective. Generally,
for the read only case, WARNING is used. In no case is the error propagated out
of the function; cursory glances reveal that it is usually not a critical error.
I may be entirely wrong in some cases.

In the case of ffserver, some nearby improvements were done. Most serious was the
build failure on non Linux machines.

Ganesh Ajjanagadde (13):
  lavc/dvdsubdec: check fclose return value
  lavfi/vf_deshake: check fclose return value
  lavfi/vf_lut3d: check fclose return value
  lavfi/vf_paletteuse: check fclose return value
  lavfi/vf_psnr: check fclose return value
  lavfi/vf_ssim: check fclose return value
  lavfi/vf_vidstabdetect: check fclose return value
  lavfi/vf_vidstabtransform: check fclose return value
  ffserver: check fclose return value
  ffserver: fix build failure on non linux machines
  ffserver: log diagnostics for popen return failure
  ffserver: correct indentation
  ffserver_config: check fclose return value

 ffserver.c                        | 48 +++++++++++++++++++++++++++------------
 ffserver_config.c                 | 10 ++++++--
 libavcodec/dvdsubdec.c            |  3 ++-
 libavfilter/vf_deshake.c          |  5 +++-
 libavfilter/vf_lut3d.c            |  3 ++-
 libavfilter/vf_paletteuse.c       |  8 ++++++-
 libavfilter/vf_psnr.c             |  5 +++-
 libavfilter/vf_ssim.c             |  5 +++-
 libavfilter/vf_vidstabdetect.c    |  5 +++-
 libavfilter/vf_vidstabtransform.c |  4 +++-
 10 files changed, 72 insertions(+), 24 deletions(-)


More information about the ffmpeg-devel mailing list