[FFmpeg-devel] [PATCH] Add AMR-NB decoder, next try

Colin McQuillan m.niloc
Sun Feb 14 11:05:56 CET 2010


On 31 January 2010 20:59, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
>
> On Jan 31, 2010, at 3:45 PM, Martin Storsj? <martin at martin.st> wrote:
>>
>> When testing this in valgrind, I noticed that decode_fixed_sparse only
>> initializes the no_repeat_mask field for some modes, but not for all,
>> triggering warnings for using uninitialized data in ff_set_fixed_vector
>> and ff_clear_fixed_vector.
>
> That's expected, I just added that and Colin probably didn't update the SoC
> tree yet. We'll fix that before it's committed.

Is it ok to just initialize the struct to 0? I.e:

--- amr/amrnbdec.c      Sat Jan 30 05:22:15 2010        (r5614)
+++ amr/amrnbdec.c      Mon Feb  1 20:58:04 2010        (r5615)
@@ -963,7 +963,7 @@ static int amrnb_decode_frame(AVCodecCon
    float *buf_out = data;                   // pointer to the output
data buffer
    int i, subframe;
    float fixed_gain_factor;
-    AMRFixed fixed_sparse;                   // fixed vector up to
anti-sparseness processing
+    AMRFixed fixed_sparse = { 0 };           // fixed vector up to
anti-sparseness processing
    float spare_vector[AMR_SUBFRAME_SIZE];   // extra stack space to
hold result from anti-sparseness processing
    float synth_fixed_gain;                  // the fixed gain that
synthesis should use
    const float *synth_fixed_vector;         // pointer to the fixed
vector that synthesis should use



More information about the ffmpeg-devel mailing list