summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs
diff options
context:
space:
mode:
authorroman.artiukhin <bahusdrive@gmail.com>2023-10-03 18:36:09 +0300
committerroman.artiukhin <bahusdrive@gmail.com>2023-10-03 18:36:22 +0300
commit69f62b78915e360a1bcb18fcb7383ab1fa716c57 (patch)
treea3c6401aff1bb95306fd959bad8b9aebc9e8a21e /lib/rbcodec/codecs
parentb64d46d9d450588e00555a5c12c2fc119448657e (diff)
downloadrockbox-69f62b78915e360a1bcb18fcb7383ab1fa716c57.tar.gz
rockbox-69f62b78915e360a1bcb18fcb7383ab1fa716c57.zip
Codecs: mp4: Fix seek to end of track
Fix possible crash due to out of bound access. Fixes FS#13371 Change-Id: I90d28fa89ceb22e6561d33abc5f2b4c7f32d323c
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r--lib/rbcodec/codecs/aac.c2
-rw-r--r--lib/rbcodec/codecs/alac.c2
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)
185 } 185 }
186 NeAACDecPostSeekReset(decoder, i); 186 NeAACDecPostSeekReset(decoder, i);
187 ci->seek_complete(); 187 ci->seek_complete();
188 if (i >= demux_res.num_sample_byte_sizes)
189 break;
188 } 190 }
189 191
190 action = CODEC_ACTION_NULL; 192 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)
127 set_elapsed_samples(samplesdone); 127 set_elapsed_samples(samplesdone);
128 128
129 ci->seek_complete(); 129 ci->seek_complete();
130 if (i >= demux_res.num_sample_byte_sizes)
131 break;
130 } 132 }
131 133
132 /* Request the required number of bytes from the input buffer */ 134 /* Request the required number of bytes from the input buffer */