avcodec/amrwbdec: assert mode to be valid in decode_fixed_vector()

Inspired-by: CID1473499 Uninitialized scalar variable

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a3bb269db9)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/6.1
Michael Niedermayer 10 months ago
parent 5017839ca0
commit e2afcd74ce
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      libavcodec/amrwbdec.c

@ -26,6 +26,7 @@
#include "config.h"
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/lfg.h"
@ -554,6 +555,8 @@ static void decode_fixed_vector(float *fixed_vector, const uint16_t *pulse_hi,
decode_6p_track(sig_pos[i], (int) pulse_lo[i] +
((int) pulse_hi[i] << 11), 4, 1);
break;
default:
av_assert2(0);
}
memset(fixed_vector, 0, sizeof(float) * AMRWB_SFR_SIZE);

Loading…
Cancel
Save