On Mon, Feb 10, 2014 at 7:13 AM, Diego Biurrun <[email protected]> wrote:
> On Sat, Feb 08, 2014 at 08:59:33PM -0500, Andrew Kelley wrote:
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -467,6 +467,80 @@ To fix a 5.1 WAV improperly encoded in AAC's native 
>> channel order
>> +
>> +@item attacks
>> +@item decays
>> +Set list of times in seconds for each channel over which the instantaneous 
>> level
>> +of the input signal is averaged to determine its volume. @var{attacks} 
>> refers to
>
> What is an "instantaneous level"?  A "current level"?

An instantaneous level is the peak of a single sample.

>> +    layouts = ff_all_channel_layouts();
>> +    if (!layouts)
>> +        return AVERROR(ENOMEM);
>> +    ff_set_common_channel_layouts(ctx, layouts);
>> +
>> +    formats = ff_make_format_list(sample_fmts);
>> +    if (!formats)
>> +        return AVERROR(ENOMEM);
>> +    ff_set_common_formats(ctx, formats);
>> +
>> +    formats = ff_all_samplerates();
>> +    if (!formats)
>> +        return AVERROR(ENOMEM);
>> +    ff_set_common_samplerates(ctx, formats);
>
> This looks like you leak memory if the second or third allocation fails
> and you return early.

Are you sure? It looks to me like memory ownership transfers to some kind of
reference counting in those ff_set_common_* functions.

>> +    int chan, i, av_uninit(dindex), oindex, av_uninit(count);
>
> The av_uninit look fishy.  Why are they necessary?

Because they are only assigned inside the loop that iterates over each channel.
We assume that there will be at least one channel, but the compiler does not
know that. Hence the av_uninit.


>
>> +static char *av_strtok(char *s, const char *delim, char **saveptr)
>
> What's the problem with just using strtok()?

strtok does not have the saveptr argument.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to