summaryrefslogtreecommitdiff
path: root/apps/codecs/libfaad/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libfaad/syntax.c')
-rw-r--r--apps/codecs/libfaad/syntax.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/apps/codecs/libfaad/syntax.c b/apps/codecs/libfaad/syntax.c
index 4c7baab274..af1a50f4d8 100644
--- a/apps/codecs/libfaad/syntax.c
+++ b/apps/codecs/libfaad/syntax.c
@@ -1031,11 +1031,14 @@ static uint8_t fill_element(NeAACDecHandle hDecoder, bitfile *ld, drc_info *drc
1031 hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength, 1031 hDecoder->sbr[sbr_ele] = sbrDecodeInit(hDecoder->frameLength,
1032 hDecoder->element_id[sbr_ele], sbr_ele, 1032 hDecoder->element_id[sbr_ele], sbr_ele,
1033 2*get_sample_rate(hDecoder->sf_index), 1033 2*get_sample_rate(hDecoder->sf_index),
1034 hDecoder->downSampledSBR 1034 hDecoder->downSampledSBR, 0);
1035#ifdef DRM 1035#ifndef FAAD_STATIC_ALLOC
1036 , 0 1036 if (hDecoder->sbr[sbr_ele] == NULL)
1037 {
1038 /* could not allocate memory */
1039 return 28;
1040 }
1037#endif 1041#endif
1038 );
1039 } 1042 }
1040 1043
1041 hDecoder->sbr_present_flag = 1; 1044 hDecoder->sbr_present_flag = 1;
@@ -1249,10 +1252,24 @@ void aac_scalable_main_element(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo
1249 { 1252 {
1250 hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0], 1253 hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
1251 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1); 1254 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
1255#ifndef FAAD_STATIC_ALLOC
1256 if (hDecoder->sbr[0] == NULL)
1257 {
1258 /* could not allocate memory */
1259 hInfo->error = 28;
1260 return;
1261 }
1262#endif
1252 } 1263 }
1253 1264
1254 /* Reverse bit reading of SBR data in DRM audio frame */ 1265 /* Reverse bit reading of SBR data in DRM audio frame */
1255 revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t)); 1266 revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
1267 if (revbuffer == NULL)
1268 {
1269 /* could not allocate memory */
1270 hInfo->error = 28;
1271 return;
1272 }
1256 prevbufstart = revbuffer; 1273 prevbufstart = revbuffer;
1257 pbufend = &buffer[buffer_size - 1]; 1274 pbufend = &buffer[buffer_size - 1];
1258 for (i = 0; i < buffer_size; i++) 1275 for (i = 0; i < buffer_size; i++)