diff --git a/lib/rbcodec/codecs/aac.c b/lib/rbcodec/codecs/aac.c index 1f5165ad05..8353f0b1bf 100644 --- a/lib/rbcodec/codecs/aac.c +++ b/lib/rbcodec/codecs/aac.c @@ -185,6 +185,8 @@ enum codec_status codec_run(void) } NeAACDecPostSeekReset(decoder, i); ci->seek_complete(); + if (i >= demux_res.num_sample_byte_sizes) + break; } action = CODEC_ACTION_NULL; diff --git a/lib/rbcodec/codecs/alac.c b/lib/rbcodec/codecs/alac.c index 0bf354080c..34f447df47 100644 --- a/lib/rbcodec/codecs/alac.c +++ b/lib/rbcodec/codecs/alac.c @@ -127,6 +127,8 @@ enum codec_status codec_run(void) set_elapsed_samples(samplesdone); ci->seek_complete(); + if (i >= demux_res.num_sample_byte_sizes) + break; } /* Request the required number of bytes from the input buffer */