Commit graph

409 commits

Author SHA1 Message Date
William Wilgus
235e41578b metadata/mp3data.c init vars & add sanity checks
Change-Id: Idface0ea73c4a6f0d46a57bddf77db9475a972f4
2021-08-11 22:40:09 -04:00
William Wilgus
30945f1180 metadata/metadata_common.c check read for proper bytes read
Change-Id: I25d7c20d449cde4d5cfd3f57e00ff45f4c14f60b
2021-08-11 22:25:20 -04:00
William Wilgus
f05a7a10a6 metadata/metadata_common.c WS changes
Change-Id: Ieef86e94676c603a21cbb5af55e63ba628a09cdf
2021-08-11 22:16:19 -04:00
William Wilgus
7aa0e0a898 metadata/asf.c ensure variable init & add sanity checks
Change-Id: If4432549b843cafb000c3fedee12184d75da595b
2021-08-11 22:06:15 -04:00
William Wilgus
e3e72d6dba metadata/mp4.c fix small oversight / bug
didn't set the genre string to null on case entry
means read failure would leave genre string indeterminate

add explicit NULL & leave genre uninitialized

Change-Id: I1452a0b57985646c982ec80755d0df9d03745f1e
2021-08-11 08:29:02 -04:00
William Wilgus
c9e9558044 metadata/mp4.c check for read errors skip buffer appropriately
WIP

Change-Id: I770f0d911f7d9826e89d886892ff3913661a8151
2021-08-11 01:36:32 +00:00
William Wilgus
275c762bb2 As3525 wavpack_enc document some intentional switch fall through
Change-Id: I56bf439df2c05653d65f49238e886e4ef2291176
2021-08-08 09:27:27 -04:00
William Wilgus
0a6d7abd13 metadata/asap.c consolidate read char function and check return values
and a bit of cleanup using macros to make the code easier to follow

Change-Id: I2c5953a68a9f415453e508c14a9c1a5a1e84e6b5
2021-08-07 17:13:09 -04:00
William Wilgus
da778a1783 metadata/asap.c WS cleanup
Change-Id: Id3bc053a45eeea107a54dd47640fa3ceb4b04498
2021-08-07 17:07:32 -04:00
William Wilgus
57293f1fd9 metadata/vfx.c cleanup string and character handling
Change-Id: I7550d6db05b0d31a1433d0af9b2233f9dc3f5ee2
2021-08-07 04:50:14 +00:00
William Wilgus
603e749c1d metadata/smaf.c handle read errors
Change-Id: I450f1fc8e1b69ce09f9888f5384c3e23a93822a1
2021-08-07 02:53:28 +00:00
William Wilgus
8a8fd3d4a3 metadata/mp3data.c set data to 0 in case of read error
Change-Id: I15d4e3d3be4bf4531c892f4351355b0b2e8e0ca9
2021-08-06 20:55:11 -04:00
Aidan MacDonald
6b1b7b6016 Fix use of uninitialized variable in mp4 metadata parser
Change-Id: Idca69e7429af13609785755d4e152d87f471c462
2021-08-06 16:10:41 +00:00
Solomon Peachy
9f0f2c6658 metadata: Fix sign extension in get_uint64_le() routine
Change-Id: Ibd85cf72ac1babd1fa636c341b90b76bdfc0491b
2021-08-05 13:44:39 +00:00
William Wilgus
848633f921 lib/skin_parser check that malloc succeeded
Change-Id: I32db233a53b0f693f815cf96bcbe6711c366e5b3
2021-08-05 10:38:18 +00:00
Aidan MacDonald
005c414e5f Document intentional fallthroughs + fix harmless unintended ones
Change-Id: I1ca5b1027ec30cbf61093bab35b980196ed14e6b
2021-08-04 18:59:46 +00:00
William Wilgus
0501af8b06 metadata/flac.c fix potential buffer overrun
Change-Id: Iee12f251455c4fda9d91d10e466d17e5e02046b9
2021-08-02 03:00:01 +00:00
William Wilgus
247731fe8c id3tags.c check for buffer overrun
Change-Id: I74fde8e234fe85abfabefddcea7f10038167c715
2021-08-01 22:29:14 -04:00
Aidan MacDonald
2e9443104f rbcodec: Fix typo in makefile
Hopefully this will fix all those random build failures.

Change-Id: I02ff625c538a21f20b33874b4ab54ed8c893a433
2021-07-25 15:55:36 +01:00
William Wilgus
363f6595b4 tlsf make ~0 explicitly unsigned ~0u
Change-Id: Ib3220df24fee470416ef813b89bdc5f27e455af7
2021-07-22 23:23:51 +00:00
Solomon Peachy
144d1b1e81 misc: Fix up a few warnings uncovered by LTO
* direct use of memcpy() instead of ci->memcpy() in flac and mod
 * uninitialized variable in mpegplayer

Change-Id: I2d08682d5f66c319780e69e3ff63d600c61d8f5a
2021-07-15 18:37:42 +00:00
Solomon Peachy
2e9b93dc5d build: Nuke the ASMFLAGS workaround for gcc 3.4.x
Change-Id: I0f21e9539d39afd54916fa8d84ce798eef474a2c
2021-07-08 20:47:30 -04:00
Solomon Peachy
2ff3425ab1 build: Rename SHARED_LDFLAG to SHARED_LDFLAGS
Change-Id: Icb81c72fbcfcdad624112a386ba38a40a830d18f
2021-07-08 19:53:05 -04:00
Solomon Peachy
2ed4bf8a43 FS#13299: Handle MP3 files with more than 128K of headers before audio data
Encountered a file with ~600K of ID3v1 headers.

Optimize the potential overhead by minimizing reverse seeks.

Change-Id: I972dbf1af1c36659f19c7ab4eed0b9149c642880
2021-06-16 17:37:29 -04:00
Solomon Peachy
fa9ddd5af9 Revert "FS#13299: Simplify VBR frame parsing in the metadata decoder."
This reverts commit 756c0d2ac8.

Change-Id: I5f98972f69e7645239fd9218c9d4eeb9bd2ec7a5
2021-06-16 16:58:47 -04:00
Solomon Peachy
756c0d2ac8 FS#13299: Simplify VBR frame parsing in the metadata decoder.
The old code would seek forward by the frame length, expecting to see a
frame header there, perform a validity check, and then seek back to the
current header.

Unfortunately this doesn't handle situations where there is extra padding
between the frames, leading us to potentially read garbage, causing the
validity tests to fail and rejecting the file outright.

Instead, keep track of the previous valid header/position, and if we find
"valid" headers in a row return the first after seeking back to it.

This change allows the file referenced in FS13299 to be properly parsed, but
further work is needed to get the file to be playable.  (file reports itself
as layer 1, variable bit rate, variable sample rate!)

Change-Id: I85f61a6360cc041a172db4b7a6b5516e5b60ceee
2021-06-13 12:13:03 -04:00
Solomon Peachy
942b1dd072 FS13094: Fix a divide-by-zero crash parsing zero-length WMA/ASF files
Change-Id: I2e90692327c69c4467a586b23b877c596b8d2c40
2021-05-12 18:22:06 -04:00
Aidan MacDonald
9a19360398 Add microtar library (for use by M3K bootloader)
This is an MIT-licensed library for reading and writing v7 format
tar files. The version here is my fork, which fixes security issues
in the original code (it hasn't been updated in 4 years, probably
abandoned by the author).

Change-Id: I86d41423dacc46e9fa0514b4fc7386a96c216e86
2021-05-12 11:30:13 +01:00
William Wilgus
14c6bb798d Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
2021-04-23 14:23:04 +00:00
amachronic
0fb333c85e rbcodec: Fix typo in include guard
Change-Id: I503ace58fb46e803c66b92113d2be7daebeb8b71
2021-04-06 17:27:06 +01:00
Christian Soffke
a8846e3003 Increase id3v2 max item size on high mem targets
As per multiple user requests:
https://forums.rockbox.org/index.php/topic,53319.msg

The acceptable size for id3v2 fields currently maxes out at
240 bytes on targets with more than 2MB of memory.

The comments field, especially for Podcasts, can sometimes
contain significantly more characters than Rockbox allows.

The limit for devices with more than 8MB of memory
is increased to 500 bytes for individual fields, and
to 1800 bytes for the buffer containing all fields.

Change-Id: I4593372229158756f102f67bcc4a43e64f632d58
2021-03-22 02:50:51 +00:00
Solomon Peachy
2628155fc9 Clean up places that use #if defined(CPU_ARM | CPU_COLDFIRE | CPU_MIPS)
Since that encompasses _all_ of our native targets in a post-archos world,
either replace it with #if (CONFIG_PLATFORM & PLATFORM_NATIVE) or
delete it altogher as appropriate.

Change-Id: I9128a456e850d5c96a9e05806aad3acd923f90c5
2021-03-04 14:14:33 +00:00
William Wilgus
2cde135cfe flac fix dumb typo
Change-Id: Ic6269ca35374bcb1d6a5ad2c1848a1718fa4e01c
2021-03-03 02:58:34 +00:00
William Wilgus
118191479d Nudge flac towards upstream FS#13266 -- Fix the Yellow still?
Change-Id: I76056b1a682db055857d759d2ebffae111a8a4c0
2021-03-02 19:47:07 -05:00
William Wilgus
2252bde144 Nudge flac towards upstream FS#13266 -- Fix Yellow
unused variables

Change-Id: I69e1435941da6207c75d0f3cb862dee296a5cc1a
2021-03-02 19:20:39 -05:00
William Wilgus
a017219488 Nudge flac towards upstream FS#13266
Some flac encoded files contain junk that our decoder
picked up

upstream has some sign and overflow fixes too

Change-Id: I5857b2fe56906a48f04944cdfee8fe2306f2c3fd
2021-03-02 23:48:05 +00:00
Solomon Peachy
7418ec5009 FS#13267: Fix crash when enabling Perceptual Bass Enhancment during playback
I think the assumption is that during playback, the DSP is already running
so it assumes PBE needs to be flushed before it is properly enabled.

Change-Id: I2bac3d02c80f97c8d9ce26a575175f6344a8e86a
2021-03-01 19:02:22 +00:00
Solomon Peachy
670812a44a Support MP3 audiostreams embedded in ASF containers.
Full credit to Igor Poretsky

Change-Id: I54769e33665cada1e1e0ef3a5511b56c8e1b859a
2021-02-28 16:11:54 +00:00
Solomon Peachy
bdc3dd4fca MP4: append mdat sections together in metadata parser
mp4 files can have multiple 'mdat' chunks.  This is common for
audiobooks, where there is often a secondary mdat containing the
chapter names, but it's also legal to have multiple mdat chunks
for a single logical "track"

This confuses the mp4 metadata parser, which assumes there is
only a single mdat, and always uses the last mdat seen to
determine the "filesize" of the data we're trying to decode.

Work around this by appending each mdat's size to result in the final
"filesize"

Change-Id: I3e7a7efb0f05ef965e8d77f79e450c957524a480
2021-02-19 13:35:41 +00:00
Solomon Peachy
621e363e70 libgme: Fix yellow in hosted MIPS builds
Change-Id: I6d25c014cc519ddc5d1619c25d48331f512c2f2f
2020-10-28 07:30:10 -04:00
Solomon Peachy
bcbf8bbf0a wmapro: Backport multiple fixes
upstream commits:

 780d454
 b28c678
 9166f48
 97a5add
 b21ba20
 f734671
 b86dd1
 b4027d9
 50f0a6b
 4c0080b
 c7a7605
 5dcb990
 7ad698e

Change-Id: I8e6d74316e1eaf22217a57ddb54c1ea8303e6788
2020-10-28 02:12:01 +00:00
Solomon Peachy
b4865b05b0 Build: Bump all toolchains to GCC 4.9.4 + Binutils 2.26.1
GCC 4.9.4 was already used for MIPS and all hosted targets; this enables
it across the board for everything (ie m68k and arm native)

Other changes:

 * Use '-Os' as the default optiomization for all targets
   (was only disabled for arm native)
 * Enable -funit-at-a-time and -Wextra
 * Drop all obsolete toolchain patches
 * Update ARM multilib/exception patch
 * Bump toolchain libs (gmp, mpfr, mpc) to recommended versions, and
   add 'isl' to enable better optimization & vectorization opportunities.

   (Will revisit optimization for the codecs and plugins at a later date)

Confirmed working:

 * armv4t     (ipodmini2g and many other PP502x targets)
 * arm >= v5  (sansaclipplus, ipod6g, ipodnano2g, sansafuzeplus)
 * m68k (ihp100)

Change-Id: If9ed405ae0f289d9adea46d4cf46bfefc2f4250d
2020-10-13 16:27:07 +00:00
Solomon Peachy
4231c2c83f codecs: Add support for the 'VTX' ZX Spectrum chiptunes format.
This codec requires floating point.

Original author:  Peter Sovietov
Ported to Rockbox:  Roman Skylarov
Further integration and bugfixes:  Solomon Peachy

Change-Id: I781ecd3592dfcdbbc694063334350342534f1d6c
2020-10-09 11:39:25 -04:00
Solomon Peachy
49a2953ade surround: Fix two issues with the haas surround code.
1) Handle ID 0 is legal
 2) Make sure handle is initialized before trying to memset its buffer

Change-Id: I91db157863800c01dd9b92bc05a1df5c4fe0e95b
2020-09-08 13:38:26 +00:00
Dominik Riebeling
5f5e44f593 skin_parser: Modernize Makefile.
- Avoid use of uname, instead ask the compiler about the binaries it
  creates.
- Move platform specific commands used into functions.
- Replace use of echo with make functions.

Change-Id: I365f656e02ddb90ee91ae60fec1230b4aaaf224f
2020-09-04 19:13:54 +02:00
Solomon Peachy
8c7780bafc flac: fix warning introduced in 5758a05
Change-Id: I649f7c356b8b790d6dfbd071a8e391a84d0cdcca
2020-08-10 14:32:40 -04:00
Yuxuan Shui
5758a055fb Handle EOF properly in get_flac_metadata
Change-Id: I5e581990046a9f4a0859787aff2fd6fc06fbf7f5
2020-08-10 14:14:58 -04:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00