diff options
author | roman.artiukhin <bahusdrive@gmail.com> | 2023-09-05 00:31:56 +0300 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2023-09-15 09:08:02 -0400 |
commit | d2f7777f7a80267af38b29f1301c70fcf04df580 (patch) | |
tree | cba9ae2aaee0ff1e71b812b35d4d0fa3407b85c6 /lib/rbcodec/metadata/mp4.c | |
parent | df51d49b22d0652a355e48cd33934a14fb0acc07 (diff) | |
download | rockbox-d2f7777f7a80267af38b29f1301c70fcf04df580.tar.gz rockbox-d2f7777f7a80267af38b29f1301c70fcf04df580.zip |
Codecs: mp4: metadata: Fix time length in very large files
Fix 40 hours long book reported as 14 hours due to samples overflow
Change-Id: I5988d4492b1f51081fff921180de6fe384ab5f4f
Diffstat (limited to 'lib/rbcodec/metadata/mp4.c')
-rw-r--r-- | lib/rbcodec/metadata/mp4.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/rbcodec/metadata/mp4.c b/lib/rbcodec/metadata/mp4.c index 19e6b515c7..7686165a0d 100644 --- a/lib/rbcodec/metadata/mp4.c +++ b/lib/rbcodec/metadata/mp4.c | |||
@@ -707,13 +707,11 @@ static bool read_mp4_container(int fd, struct mp3entry* id3, | |||
707 | * need any further special handling. */ | 707 | * need any further special handling. */ |
708 | if (id3->codectype==AFMT_MP4_AAC_HE && l<=1024) | 708 | if (id3->codectype==AFMT_MP4_AAC_HE && l<=1024) |
709 | { | 709 | { |
710 | id3->samples += n * l * 2; | 710 | l *= 2; |
711 | id3->needs_upsampling_correction = true; | 711 | id3->needs_upsampling_correction = true; |
712 | } | 712 | } |
713 | else | 713 | |
714 | { | 714 | id3->samples += (uint64_t) n * l; |
715 | id3->samples += n * l; | ||
716 | } | ||
717 | } | 715 | } |
718 | 716 | ||
719 | size = 0; | 717 | size = 0; |