avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7e104647a3
)
Conflicts:
libavcodec/alsdec.c
This commit is contained in:
@@ -1731,9 +1731,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
// allocate and assign channel data buffer for mcc mode
|
// allocate and assign channel data buffer for mcc mode
|
||||||
if (sconf->mc_coding) {
|
if (sconf->mc_coding) {
|
||||||
ctx->chan_data_buffer = av_malloc(sizeof(*ctx->chan_data_buffer) *
|
ctx->chan_data_buffer = av_mallocz(sizeof(*ctx->chan_data_buffer) *
|
||||||
num_buffers * num_buffers);
|
num_buffers * num_buffers);
|
||||||
ctx->chan_data = av_malloc(sizeof(*ctx->chan_data) *
|
ctx->chan_data = av_mallocz(sizeof(*ctx->chan_data) *
|
||||||
num_buffers);
|
num_buffers);
|
||||||
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
|
ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
|
||||||
num_buffers);
|
num_buffers);
|
||||||
|
Reference in New Issue
Block a user