[FFmpeg-devel] [PATCH] libavcodec/lpc.c: Fix warning about uninitialized variable

Justin Ruggles justin.ruggles
Wed Feb 11 03:05:43 CET 2009


Jai Menon wrote:
> On Tue, Feb 10, 2009 at 2:38 PM, Patrik Kullman <patrik at yes.nu> wrote:
>>
>> On Tue, 2009-02-10 at 14:29 +0530, Jai Menon wrote:
>>> On Tue, Feb 10, 2009 at 2:14 PM, Jai Menon <jmenon86 at gmail.com> wrote:
>>>> On Tue, Feb 10, 2009 at 2:08 PM, Patrik Kullman <patrik at yes.nu> wrote:
>>>>> If use_lpc < 1 and max_order > 0, weight would be uninitialized.
>>>> since a use_lpc of 0 was never intended, maybe an assert could be used....
>>> to clarify, i meant an assert on use_lpc == 0
>> Well, a negative value in use_lpc wouldn't initialize weight either.
>> Are negative values intended?
> 
> Justin could probably comment but semantically it makes no sense.
> also, this is supposed  to be used internally so asserting should be ok.
> anyhow, please wait for others to comment/approve/disapprove.

Adding "assert(use_lpc > 0);" sounds like a good idea. Perhaps that
parameter should have better documentation as well.
0  = LPC with fixed pre-defined coeffs
1  = LPC with coeffs determined by Levinson-Durbin recursion
2+ = LPC with coeffs determined by Cholesky factorization using
(use_lpc-1) passes.

Therefore, ff_lpc_calc_coefs() should not be called with use_lpc<=0.

-Justin





More information about the ffmpeg-devel mailing list