[FFmpeg-devel] [PATCH] Fix leak in mov.c

Baptiste Coudurier baptiste.coudurier
Wed May 21 19:23:22 CEST 2008


Hi,

Albert Astals Cid wrote:
> El Wednesday 21 May 2008 00:59:12 Baptiste Coudurier va escriure:
>> [...]
>>
>> Code must be under #ifdef CONFIG_ZLIB, otherwise it is just dead code.
> 
> Right.
> 
> [...]
>
> Index: mov.c
> ===================================================================
> --- mov.c	(revision 13199)
> +++ mov.c	(working copy)
> @@ -1586,9 +1586,9 @@
>      }
>      get_buffer(pb, cmov_data, cmov_len);
>      if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK)
> -        return -1;
> +        goto error;
>      if(init_put_byte(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0)
> -        return -1;
> +        goto error;
>      atom.type = MKTAG('m','o','o','v');
>      atom.offset = 0;
>      atom.size = moov_len;
> @@ -1599,6 +1599,10 @@
>      av_free(moov_data);
>      av_free(cmov_data);
>      return ret;
> +error:
> +    av_free(moov_data);
> +    av_free(cmov_data);
> +    return -1;
>  #else
>      av_log(c->fc, AV_LOG_ERROR, "this file requires zlib support compiled in\n");
>      return -1;

Seems there is still code duplication here :)

-- 
Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Smartjog USA Inc.                                http://www.smartjog.com
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA




More information about the ffmpeg-devel mailing list