[FFmpeg-devel] [PATCH] Fixed memory leaks associated with AVStream objects if FF_API_LAVF_AVCTX is defined

Michael Niedermayer michael at niedermayer.cc
Fri Apr 21 18:09:45 EEST 2017


On Thu, Apr 20, 2017 at 11:30:13PM -0700, Aaron Levinson wrote:
> From 4f27e910aca6dae6642b4d73cf07fa0d6c4b1618 Mon Sep 17 00:00:00 2001
> From: Aaron Levinson <alevinsn at aracnet.com>
> Date: Thu, 20 Apr 2017 23:20:20 -0700
> Subject: [PATCH] Fixed memory leaks associated with AVStream objects if
>  FF_API_LAVF_AVCTX is defined
> 
> Purpose: Fixed memory leaks associated with AVStream objects if
> FF_API_LAVF_AVCTX is defined.  If FF_API_LAVF_AVCTX is defined,
> AVStream::codec is set to an AVCodecContext object, and this wasn't
> being deallocated properly when the AVStream object was freed.  While
> FF_API_LAVF_AVCTX has to do with deprecated functionality, in
> practice, it will always be defined for typical builds currently,
> since it is defined in libavformat\version.h if
> LIBAVFORMAT_VERSION_MAJOR is less than 58, and
> LIBAVFORMAT_VERSION_MAJOR is currently set to 57.
> 
> Comments:
> 
> -- libavformat/utils.c: Now using avcodec_free_context() to properly
>    deallocate st->codec in free_stream() if FF_API_LAVF_AVCTX is
>    defined.
> ---
>  libavformat/utils.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

please use "make fate" to test your changes

This one causes many all? tests to segfault

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- 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/20170421/6d6a984e/attachment.sig>


More information about the ffmpeg-devel mailing list