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

wm4 nfxjfg at googlemail.com
Sat Aug 16 01:48:27 CEST 2014


On Sat, 16 Aug 2014 01:44:59 +0200
Michael Niedermayer <michaelni at gmx.at> wrote:

> 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

Oh, sorry, it wasn't clear from the context. Nevermind.


More information about the ffmpeg-devel mailing list