Index: apps/codecs/libfaad/decoder.c =================================================================== --- apps/codecs/libfaad/decoder.c (revision 29783) +++ apps/codecs/libfaad/decoder.c (working copy) @@ -77,9 +77,10 @@ /* static function declarations */ static void* aac_frame_decode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, uint8_t *buffer, uint32_t buffer_size); +/* not used by rockbox static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo); +*/ - char* NEAACDECAPI NeAACDecGetErrorMessage(uint8_t errcode) { if (errcode >= NUM_ERROR_MESSAGES) @@ -305,6 +306,12 @@ } #endif + /* A maximum of MAX_CHANNELS channels is supported. */ + if (*channels > MAX_CHANNELS) + { + return -1; + } + #ifdef SBR_DEC /* implicit signalling */ if (*samplerate <= 24000 && !(hDecoder->config.dontUpSampleImplicitSBR)) @@ -399,6 +406,13 @@ *channels = 2; } #endif + + /* A maximum of MAX_CHANNELS channels is supported. */ + if (*channels > MAX_CHANNELS) + { + return -1; + } + hDecoder->sf_index = mp4ASC.samplingFrequencyIndex; hDecoder->object_type = mp4ASC.objectTypeIndex; #ifdef ERROR_RESILIENCE @@ -520,6 +534,8 @@ } } +/* not used by rockbox */ +#if 0 static void create_channel_config(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo) { hInfo->num_front_channels = 0; @@ -724,6 +740,7 @@ } } } +#endif void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder, NeAACDecFrameInfo *hInfo, @@ -882,7 +899,9 @@ #endif /* Make a channel configuration based on either a PCE or a channelConfiguration */ + /* not used by rockbox create_channel_config(hDecoder, hInfo); + */ /* number of samples in this frame */ hInfo->samples = frame_len*output_channels;