[FFmpeg-devel] [PATCH v4] libavcodec: Add FLAC API test
Michael Niedermayer
michaelni at gmx.at
Mon Apr 20 15:26:00 CEST 2015
On Mon, Apr 20, 2015 at 02:38:47PM +0200, Michael Niedermayer wrote:
> On Mon, Apr 20, 2015 at 03:03:08AM +0300, Ludmila Glinskih wrote:
> > Signed-off-by: Ludmila Glinskih <lglinskih at gmail.com>
> > ---
> > libavcodec/Makefile | 1 +
> > libavcodec/api-flac-test.c | 290 +++++++++++++++++++++++++++++++++++++++++++++
> > tests/fate/libavcodec.mak | 6 +
> > 3 files changed, 297 insertions(+)
> > create mode 100644 libavcodec/api-flac-test.c
> [...]
> > +static int close_encoder(AVCodecContext *enc_ctx)
> > +{
> > + avcodec_close(enc_ctx);
> > + av_freep(&enc_ctx);
> > + return 0;
> > +}
> > +
> > +static int close_decoder(AVCodecContext *dec_ctx)
> > +{
> > + avcodec_close(dec_ctx);
> > + av_freep(&dec_ctx);
> > + return 0;
> > +}
>
> the idea of av_freep() is to clear the freed pointer so no stale
> pointer is left that could be dereferenced by mistake
> fixed that
> applied
also please send a patch to fix the { } placement as nicolas suggested
Thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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/20150420/4052dbcf/attachment.asc>
More information about the ffmpeg-devel
mailing list