[FFmpeg-devel] [PATCH v4] libavcodec: Add FLAC API test
Michael Niedermayer
michaelni at gmx.at
Mon Apr 20 14:38:47 CEST 2015
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
thanks
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- 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/20150420/0e308ffb/attachment.asc>
More information about the ffmpeg-devel
mailing list