diff options
-rw-r--r-- | apps/codecs/aac.c | 10 | ||||
-rw-r--r-- | apps/codecs/libm4a/m4a.c | 3 | ||||
-rw-r--r-- | docs/CREDITS | 1 |
3 files changed, 8 insertions, 6 deletions
diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index 60460355da..7d706f4fd8 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c | |||
@@ -53,6 +53,7 @@ enum codec_status codec_main(void) | |||
53 | int err; | 53 | int err; |
54 | uint32_t s = 0; | 54 | uint32_t s = 0; |
55 | unsigned char c = 0; | 55 | unsigned char c = 0; |
56 | void *ret; | ||
56 | 57 | ||
57 | /* Generic codec initialisation */ | 58 | /* Generic codec initialisation */ |
58 | ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); | 59 | ci->configure(DSP_SET_STEREO_MODE, STEREO_NONINTERLEAVED); |
@@ -179,11 +180,10 @@ next_track: | |||
179 | buffer=ci->request_buffer(&n,sample_byte_size); | 180 | buffer=ci->request_buffer(&n,sample_byte_size); |
180 | 181 | ||
181 | /* Decode one block - returned samples will be host-endian */ | 182 | /* Decode one block - returned samples will be host-endian */ |
182 | NeAACDecDecode(decoder, &frame_info, buffer, n); | 183 | ret = NeAACDecDecode(decoder, &frame_info, buffer, n); |
183 | /* Ignore return value, we access samples in the decoder struct | 184 | |
184 | * directly. | 185 | /* NeAACDecDecode may sometimes return NULL without setting error. */ |
185 | */ | 186 | if (ret == NULL || frame_info.error > 0) { |
186 | if (frame_info.error > 0) { | ||
187 | LOGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error)); | 187 | LOGF("FAAD: decode error '%s'\n", NeAACDecGetErrorMessage(frame_info.error)); |
188 | err = CODEC_ERROR; | 188 | err = CODEC_ERROR; |
189 | goto done; | 189 | goto done; |
diff --git a/apps/codecs/libm4a/m4a.c b/apps/codecs/libm4a/m4a.c index f0666403ed..92e619db35 100644 --- a/apps/codecs/libm4a/m4a.c +++ b/apps/codecs/libm4a/m4a.c | |||
@@ -194,7 +194,8 @@ unsigned int get_sample_offset(demux_res_t *demux_res, uint32_t sample) | |||
194 | prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples; | 194 | prev_chunk_samples = demux_res->sample_to_chunk[i].num_samples; |
195 | } | 195 | } |
196 | 196 | ||
197 | if (sample >= demux_res->sample_to_chunk[0].num_samples) | 197 | if (prev_chunk_samples > 0 && |
198 | sample >= demux_res->sample_to_chunk[0].num_samples) | ||
198 | { | 199 | { |
199 | chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples; | 200 | chunk = prev_chunk + (sample - total_samples) / prev_chunk_samples; |
200 | } | 201 | } |
diff --git a/docs/CREDITS b/docs/CREDITS index 0eddfbef49..23fe2ee292 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -508,6 +508,7 @@ Simon Rothen | |||
508 | Pavel Rzehák | 508 | Pavel Rzehák |
509 | Diego Herranz | 509 | Diego Herranz |
510 | Viktor Varga | 510 | Viktor Varga |
511 | Juliusz Chroboczek | ||
511 | 512 | ||
512 | The libmad team | 513 | The libmad team |
513 | The wavpack team | 514 | The wavpack team |