Skip to content

Commit

Permalink
arm: fix use of uninitialised value in ff_fft_fixed_init_arm()
Browse files Browse the repository at this point in the history
When initialising an FFTContext for a plain FFT, mdct_bits is not set
and can contain a garbage value.  Since nbits is always valid and for
MDCT operation is mdct_bits - 2 checking this instead avoids using an
uninitialised value while having the same effect.

Signed-off-by: Mans Rullgard <[email protected]>
  • Loading branch information
mansr committed Dec 7, 2012
1 parent 2c96392 commit 92dad66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/arm/fft_fixed_init_arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ av_cold void ff_fft_fixed_init_arm(FFTContext *s)
s->fft_calc = ff_fft_fixed_calc_neon;

#if CONFIG_MDCT
if (!s->inverse && s->mdct_bits >= 5) {
if (!s->inverse && s->nbits >= 3) {
s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
s->mdct_calc = ff_mdct_fixed_calc_neon;
s->mdct_calcw = ff_mdct_fixed_calcw_neon;
Expand Down

0 comments on commit 92dad66

Please sign in to comment.