summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs
diff options
context:
space:
mode:
authorroman.artiukhin <bahusdrive@gmail.com>2023-08-31 02:09:40 +0300
committerSolomon Peachy <pizza@shaftnet.org>2023-09-29 08:21:27 -0400
commitd05f6aac2d51b2c284b8185bc34383e62e2fb21f (patch)
treee600bca6085e5a8270eca487be1af77326c1b5bb /lib/rbcodec/codecs
parentfee50135149fbec0e5973caaa528826c256c66ac (diff)
downloadrockbox-d05f6aac2d51b2c284b8185bc34383e62e2fb21f.tar.gz
rockbox-d05f6aac2d51b2c284b8185bc34383e62e2fb21f.zip
Codecs: mp4: Skip FOURCC filetype chunk check
Instead of FOURCC it needs ignore-case text match. Also value can contain \0 ('m4a\0' instead of expected 'm4a ').But let's simply skip it and let decoder handle it. Change-Id: I87eefcabbc9010481286257c26cee09e61d1221c
Diffstat (limited to 'lib/rbcodec/codecs')
-rw-r--r--lib/rbcodec/codecs/libm4a/demux.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/rbcodec/codecs/libm4a/demux.c b/lib/rbcodec/codecs/libm4a/demux.c
index 47cce9857f..2b56759b9c 100644
--- a/lib/rbcodec/codecs/libm4a/demux.c
+++ b/lib/rbcodec/codecs/libm4a/demux.c
@@ -56,22 +56,13 @@ typedef struct
56/* chunk handlers */ 56/* chunk handlers */
57static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len) 57static void read_chunk_ftyp(qtmovie_t *qtmovie, size_t chunk_len)
58{ 58{
59 fourcc_t type;
60 size_t size_remaining = chunk_len - 8; 59 size_t size_remaining = chunk_len - 8;
61 60
62 type = stream_read_uint32(qtmovie->stream); 61 // filetype (supported ignore case values: m4a, m4b, mp42, 3gp6, qt, isom)
62 char filetype[4];
63 stream_read(qtmovie->stream, 4, filetype);
63 size_remaining-=4; 64 size_remaining-=4;
64 if ((type != MAKEFOURCC('M','4','A',' ')) && 65
65 (type != MAKEFOURCC('m','4','a',' ')) &&
66 (type != MAKEFOURCC('M','4','B',' ')) &&
67 (type != MAKEFOURCC('m','p','4','2')) &&
68 (type != MAKEFOURCC('3','g','p','6')) &&
69 (type != MAKEFOURCC('q','t',' ',' ')) &&
70 (type != MAKEFOURCC('i','s','o','m')))
71 {
72 DEBUGF("not M4A file\n");
73 return;
74 }
75 /* minor_ver = */ stream_read_uint32(qtmovie->stream); 66 /* minor_ver = */ stream_read_uint32(qtmovie->stream);
76 size_remaining-=4; 67 size_remaining-=4;
77 68