[FFmpeg-devel] [PATCH 1/7] doc/examples: remove unneeded NULL checks

Michael Niedermayer michaelni at gmx.at
Sat Aug 16 01:44:59 CEST 2014


On Sat, Aug 16, 2014 at 01:30:44AM +0200, wm4 wrote:
> On Sat, 16 Aug 2014 01:15:42 +0200
> Michael Niedermayer <michaelni at gmx.at> wrote:
> 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  doc/examples/resampling_audio.c |    3 +--
> >  doc/examples/scaling_video.c    |    3 +--
> >  2 files changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/doc/examples/resampling_audio.c b/doc/examples/resampling_audio.c
> > index 8a43b09..f35e7e1 100644
> > --- a/doc/examples/resampling_audio.c
> > +++ b/doc/examples/resampling_audio.c
> > @@ -199,8 +199,7 @@ int main(int argc, char **argv)
> >              fmt, dst_ch_layout, dst_nb_channels, dst_rate, dst_filename);
> >  
> >  end:
> > -    if (dst_file)
> > -        fclose(dst_file);
> > +    fclose(dst_file);
> 
> If dst_file can be NULL, then I don't think this is safe.

how can dst_file be NULL ?
but if preferred, iam happy to leave it as it is, one could argue
it to be more rubust against future changes

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

No snowflake in an avalanche ever feels responsible. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140816/e8380fbc/attachment.asc>


More information about the ffmpeg-devel mailing list