Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1061361 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm-compr: Fix possible array out of bounds



Add check to avoid possible array out of bounds in function
msm_compr_send_ddp_cfg.

CRs-fixed: 925138
Change-Id: If3915565bdea998404854bd73ff7dafb8a2b23b0
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mwang@codeaurora.org>
parent 76fef41d
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@

#include <linux/types.h>

#define SND_DEC_DDP_MAX_PARAMS 18

/* AUDIO CODECS SUPPORTED */
#define MAX_NUM_CODECS 32
#define MAX_NUM_CODEC_DESCRIPTORS 32
@@ -345,8 +347,8 @@ struct snd_enc_generic {

struct snd_dec_ddp {
	__u32 params_length;
	__u32 params_id[18];
	__u32 params_value[18];
	__u32 params_id[SND_DEC_DDP_MAX_PARAMS];
	__u32 params_value[SND_DEC_DDP_MAX_PARAMS];
} __attribute__((packed, aligned(4)));

struct snd_dec_flac {