summaryrefslogtreecommitdiff
path: root/apps/codecs/libfaad/sbr_dec.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libfaad/sbr_dec.c')
-rw-r--r--apps/codecs/libfaad/sbr_dec.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/apps/codecs/libfaad/sbr_dec.c b/apps/codecs/libfaad/sbr_dec.c
index 7f6a9bbffe..678ebfe520 100644
--- a/apps/codecs/libfaad/sbr_dec.c
+++ b/apps/codecs/libfaad/sbr_dec.c
@@ -73,20 +73,25 @@ static void sbr_save_matrix(sbr_info *sbr, uint8_t ch);
73 73
74 74
75sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, uint8_t id_ele, 75sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, uint8_t id_ele,
76 uint32_t sample_rate, uint8_t downSampledSBR 76 uint32_t sample_rate, uint8_t downSampledSBR,
77#ifdef DRM 77 uint8_t IsDRM)
78 , uint8_t IsDRM
79#endif
80 )
81{ 78{
82 (void)downSampledSBR; 79 (void)downSampledSBR;
80#ifndef DRM
81 (void)IsDRM;
82#endif
83 83
84 /* Allocate sbr_info. */ 84 /* Allocate sbr_info. */
85#if defined(FAAD_STATIC_ALLOC) 85#if defined(FAAD_STATIC_ALLOC)
86 sbr_info *sbr = &s_sbr[id_ele]; 86 sbr_info *sbr = &s_sbr[id_ele];
87#else 87#else
88 (void)id_ele; 88 (void)id_ele;
89 sbr_info *sbr =(sbr_info*)faad_malloc(sizeof(sbr_info)); 89 sbr_info *sbr = (sbr_info*)faad_malloc(sizeof(sbr_info));
90 if (sbr == NULL)
91 {
92 /* could not allocate memory */
93 return NULL;
94 }
90#endif 95#endif
91 memset(sbr, 0, sizeof(sbr_info)); 96 memset(sbr, 0, sizeof(sbr_info));
92 97
@@ -95,7 +100,12 @@ sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac, uint8_t id_ele,
95#if defined(FAAD_STATIC_ALLOC) || defined(FAAD_HAVE_XLR_IN_IRAM) 100#if defined(FAAD_STATIC_ALLOC) || defined(FAAD_HAVE_XLR_IN_IRAM)
96 p_XLR = &s_XLR; 101 p_XLR = &s_XLR;
97#else 102#else
98 p_XLR =(XLR_t*)faad_malloc(sizeof(XLR_t)); 103 p_XLR = (XLR_t*)faad_malloc(sizeof(XLR_t));
104 if (p_XLR == NULL)
105 {
106 /* could not allocate memory */
107 return NULL;
108 }
99#endif 109#endif
100 memset(p_XLR, 0, sizeof(XLR_t)); 110 memset(p_XLR, 0, sizeof(XLR_t));
101 111