[FFmpeg-devel] [PATCH] ffmpeg: check fclose return values

Michael Niedermayer michael at niedermayer.cc
Thu Jan 7 23:16:27 CET 2016


On Thu, Jan 07, 2016 at 10:00:47AM -0800, Ganesh Ajjanagadde wrote:
> On Thu, Jan 7, 2016 at 9:27 AM, Michael Niedermayer
> <michael at niedermayer.cc> wrote:
> > On Wed, Jan 06, 2016 at 09:00:46PM -0800, Ganesh Ajjanagadde wrote:
> >> 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.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> >> ---
> >>  ffmpeg.c | 13 ++++++++++---
> >>  1 file changed, 10 insertions(+), 3 deletions(-)
> >
> > LGTM
> >
> > thanks
> 
> So there is actually a problem with the diagnostic obtained, a more
> accurate diagnostic is via errno, say strerror(errno) instead of
> av_err2str(ret).
> Comparison:
> Error closing vstats file, loss of information possible: Operation not permitted
> vs
> Error closing vstats file, loss of information possible: No space left on device
> for the provided /dev/full example.
> 
> So there are a number of possiblities:
> 1. Have 2 separate av_log lines, one for each of these.
> 2. A single av_log line, using strerror(errno).
> 3. Leave as is.
> 
> I prefer 2. Let me know your preference, and I will push later.

yes agree, 2.

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160107/c0a80519/attachment.sig>


More information about the ffmpeg-devel mailing list