[FFmpeg-devel] [PATCH] Get done with if (p) before av_free and av_freep

Måns Rullgård mans
Fri Feb 4 11:11:37 CET 2011


Cl?ment B?sch <ubitux at gmail.com> writes:

> Hi,
>
> Here is two patches to get done with this. As requested, the first one is
> for if before av_freep calls (just two and one comment, I wasn't able to
> find more), and the second is for the av_free I missed.

Thanks, both patches queued.

> I don't think there are more, or at least not in a simple form.
>
> diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
> index 771fc2b..9008b84 100644
> --- a/libavcodec/libxvidff.c
> +++ b/libavcodec/libxvidff.c
> @@ -527,8 +527,7 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) {
>
>      xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
>
> -    if( avctx->extradata != NULL )
> -        av_freep(&avctx->extradata);
> +    av_freep(&avctx->extradata);
>      if( x->twopassbuffer != NULL ) {
>          av_free(x->twopassbuffer);

That looks like another one right there.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list