On 21/04/15 19:10, Vittorio Giovara wrote:
> avcodec_get_context_defaults3 may allocate memory, so free the context
> using the proper avcodec_free_context() function.
> ---
>  libavcodec/options.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/options.c b/libavcodec/options.c
> index c00dca0..8ff7b91 100644
> --- a/libavcodec/options.c
> +++ b/libavcodec/options.c
> @@ -131,7 +131,7 @@ AVCodecContext *avcodec_alloc_context3(const AVCodec 
> *codec)
>          return NULL;
>  
>      if(avcodec_get_context_defaults3(avctx, codec) < 0){
> -        av_free(avctx);
> +        avcodec_free_context(&avctx);
>          return NULL;
>      }
>  
> 

Probably ok, did you check what get_context_default3 does?
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to