[FFmpeg-devel] [PATCH] Simplify codebook allocation for Escape 124

Michael Niedermayer michaelni
Wed Apr 2 04:22:37 CEST 2008


On Tue, Apr 01, 2008 at 05:50:37PM -0700, Eli Friedman wrote:
> Patch per subject; some minor simplifications suggested during the
> review of the compile fix for Escape 124.
[...]

> -static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
> -                                 unsigned size)
> +static void unpack_codebook(GetBitContext* gb, unsigned depth,
> +                            unsigned size, CodeBook* cb)
>  {
>      unsigned i, j;
> -    CodeBook cb = { 0 };
>  
> +    cb->depth = depth;
> +    cb->size = 0;

> +    av_free(cb->blocks);
> +    cb->blocks = NULL;

av_freep() or maybe even av_realloc()

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080402/9eb8f512/attachment.pgp>



More information about the ffmpeg-devel mailing list