[FFmpeg-devel] [PATCH]Use av_freep in mov_create_chapter_track

Michael Niedermayer michaelni at gmx.at
Mon Mar 10 04:27:27 CET 2014


On Sun, Mar 09, 2014 at 07:50:21PM +0100, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch fixes a compilation warning here, sorry if I misinterpret the 
> code.
> 
> Please review, Carl Eugen

>  movenc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 2176f98fa78de904727b02489bc404f464fb96a1  patchfreep.diff
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 8b1816a..45fb115 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -3575,7 +3575,7 @@ static int mov_create_chapter_track(AVFormatContext *s, int tracknum)
>              track->enc->extradata = buf;
>              track->enc->extradata_size = size;
>          } else {
> -            av_free(&buf);
> +            av_freep(&buf);
>          }

LGTM

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140310/acdc6404/attachment.asc>


More information about the ffmpeg-devel mailing list