diff options
author | roman.artiukhin <bahusdrive@gmail.com> | 2023-10-03 18:36:09 +0300 |
---|---|---|
committer | roman.artiukhin <bahusdrive@gmail.com> | 2023-10-03 18:36:22 +0300 |
commit | 69f62b78915e360a1bcb18fcb7383ab1fa716c57 (patch) | |
tree | a3c6401aff1bb95306fd959bad8b9aebc9e8a21e | |
parent | b64d46d9d450588e00555a5c12c2fc119448657e (diff) | |
download | rockbox-69f62b7891.tar.gz rockbox-69f62b7891.zip |
Codecs: mp4: Fix seek to end of track
Fix possible crash due to out of bound access.
Fixes FS#13371
Change-Id: I90d28fa89ceb22e6561d33abc5f2b4c7f32d323c
-rw-r--r-- | lib/rbcodec/codecs/aac.c | 2 | ||||
-rw-r--r-- | lib/rbcodec/codecs/alac.c | 2 |
2 files changed, 4 insertions, 0 deletions
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 */ |