[FFmpeg-devel] [Patch] Fix for static leaks in h264.c

Art Clarke aclarke
Wed Jun 25 15:16:10 CEST 2008


On Wed, Jun 25, 2008 at 9:14 AM, Art Clarke <aclarke at vlideshow.com> wrote:

> On Wed, Jun 25, 2008 at 9:01 AM, M?ns Rullg?rd <mans at mansr.com> wrote:
>
>>
>> Michael Niedermayer wrote:
>> > On Tue, Jun 24, 2008 at 08:34:34PM -0400, Art Clarke wrote:
>> >> This is a continuation of the patch for leaks as in:
>> >> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-June/048859.html
>> >>
>> >> Same test case applies; this time though pass in a test file that
>> requires
>> >> the h263 decoder.  This one is slightly hairier than h263.c because I
>> had to
>> >> unroll some loops to get sufficient space in the data segment.  Yes, it
>> >> makes me feel squeamish to look at it too.
>> >
>> > Maybe init_vlc( ..., INIT_VLC_USE_NEW_STATIC) could be used in a loop
>> with
>> > a table of the sizes
>>
>> That doesn't work.  The size of static arrays must be an integer constant
>> expression.  Such an expression can, by definition, not vary in a loop.
>>
>> --
>> M?ns Rullg?rd
>> mans at mansr.com
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel at mplayerhq.hu
>> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
>
> Agree with both of you, but Michael does point the way to a more elegant
> solution I think.
>
> Attempt #2.
>
> - Art
>

And to explain the "do { ... } while(0)" that I added to the bistream.h
macros (while adding the new Macro).  While playing with the bitstream
macros, I noticed I had left out a semi-colon in one run through the source
code, which the code just compiled fine.  This weirded me out since the
INIT_VLC_* macros are really meant to be function-like, so they now require
a semi-colon after their invocation.




More information about the ffmpeg-devel mailing list