Commit graph

36269 commits

Author SHA1 Message Date
Aidan MacDonald
366f00a3d3 plugins: fix out of bounds read in chopper
GCC complains about this when compiling with UBSan.

Change-Id: I4bd8ff2b47882ab95620dc7750a9a80f823cc2ea
2022-05-02 15:38:48 +01:00
William Wilgus
ab71b9e334 tree.c update settings when new theme selected
Change-Id: I376aba4258dd3c54c45d97317aa1e7bc8f2a3a17
2022-04-28 18:56:13 -04:00
William Wilgus
f0d3a62d91 keyboard.c change math for editline above picker
Change-Id: I59e7f7face07f3f97fc6e016ee333cd3139ad5fd
2022-04-27 21:40:49 -04:00
Aidan MacDonald
9e93796407 buffering: remove bufgettail/bufcuttail
These operations can only be used in limited circumstances and have
exactly one user. bufgettail especially seems of dubious value; how
often do you need to read N bytes from the end of a file without
changing the file position?

strip_tags() was the only function using them, to strip off ID3v1
and APE tags off the end of buffered tracks. This would save only
32-192 bytes per track -- if the container format uses APE/ID3v1.
It hardly seems worth the effort.

Change-Id: I8fc3c1408517eda6126e75e76d76daea904b50eb
2022-04-20 16:51:49 -04:00
Dana Conrad
931d616071 Manual: Add Eros Q Native Bootloader download link
Forgot this in the previous patchset

Change-Id: I3f58e31e57e90cf3bc5f4b02a37ac4c99e8e52b4
2022-04-19 21:27:57 -05:00
William Wilgus
002575dbcf [BUGFIX] gui_synclist move global display settings to list struct
forgot to add the update function to the list_wraparound callback

Change-Id: I7ee7940f126726c727344d7d09371f1bf3295c81
2022-04-18 23:08:04 -04:00
Christian Soffke
1c3f6e063a fiiom3k Yes/No screen: Only accept Play button for YES
According to the on screen instructions, any other button
should mean No.

More importantly, in my experience at least, the Select
"button", since it is touch-activated, can sometimes be
pressed by accident, especially when a warning screen
is displayed as a result of pressing that same button.

Change-Id: Ieeadfa8018b5df99605297bc47948a181c22dab4
2022-04-18 22:28:13 -04:00
Dominik Riebeling
f8d54d0d1e rbutil: Bump to 1.5.1.
Change-Id: Idfc846ee1922271a709a097989c7a9a31e9d7279
2022-04-18 21:02:12 +02:00
Dominik Riebeling
3ed515872c rbutil: Fix progress dialog abort changed too early.
Don't change the abort button to Ok after a successful bootloader
install, this will be done by the following steps.

Change-Id: I4275de1f44bddf0580b10b36240a36a43daa68d0
2022-04-18 19:35:36 +02:00
Dominik Riebeling
80ac6893c0 rbutil: Update changelog.
Change-Id: I0d3ad4cba8cc5393d86cf2b96fc755ad6ec90b01
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e4cb1615f4 rbutil: run lupdate on all translations.
Change-Id: I676cddf93724e07790cd393b697c127928f3949b
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e2dc0a2c07 rbutil: Make zip install log less noisy.
No need to show a separate entry when a cached file has been used, do it
the same way as bootloader downloads do.

Change-Id: I42a21a37474a778975e82af0102e0152677a0343
2022-04-18 19:35:35 +02:00
Dominik Riebeling
1155851ffb rbutil: Make "Info" tab more responsive.
Loading the information can take a bit depending on the speed of the
disk. To make the application not appear as frozen update the UI more
often, and display a "Loading" text during data retrieval.

Change-Id: I012487d031ea71e62b583ca1c40220ea709e7034
2022-04-18 19:35:35 +02:00
Christian Soffke
e71a441762 ImageViewer: Fix buffer overflow
np_file is a buffer of size MAX_PATH. After
removing only the file name component and
leaving the rest of the path, the
available space may not be sufficient
for appending another file name (possibly of
size MAX_PATH itself) to it.

This can occur after a file of acceptable
length is opened in ImageViewer, and you
then advance to another file whose path
(including the file name) is longer than
MAX_PATH.

Change-Id: Ideadd9451359bd5735bce92fca5d983e61f300e9
2022-04-18 10:58:40 -04:00
Christian Soffke
1c66e97522 Database: Remove File View menu
These options don't seem to
apply to the database...

Change-Id: I777073eeaed4099acf44996b95fa05b4c2b3abc4
2022-04-18 10:48:41 -04:00
Aidan MacDonald
a234df30df Fix sim build for glibc >=2.34
Change-Id: If63787514b6bffc0afb71f9d651f8c6f0c328a2d
2022-04-18 09:54:07 -04:00
Christian Soffke
4d7327b04d Album Art: Eliminate redundant check
When the 'Album Art' setting was set to
'Prefer Image File' and neither image file
nor embedded artwork were found,
playback would check for files twice.

Change-Id: Ibe392928d58ec04103e2572124841724509bd859
2022-04-18 09:13:31 -04:00
Dana Conrad
b02123d349 Manual: Add Eros Q Native
Here is the PDF this patchset produces: https://www.dropbox.com/s/v1uz8p2fsgsz1ng/rockbox-erosqnative-923dabb5cd-220409.pdf?dl=0

Change-Id: I27554cb65a6498a6ccb714d4f93f25264b516e99
2022-04-18 09:09:03 -04:00
Bernd Busse
dc67d821c3 toolchain: update zlib to 1.2.12 for native mips targets
zlib has been updated to 1.2.12 on March 27, 2022 with the following note:

    Due to the bug fixes, any installations of 1.2.11 should be
    replaced with 1.2.12.

The previous version has been removed and is no longer available for
download on the official site.

Change-Id: I807fbb4605378d99654be3e4c1b28bd04de729c9
2022-04-18 09:07:39 -04:00
Dominik Riebeling
fc38cd8215 rbutil: Fix uninstall not updating install log.
Change-Id: Icd71f1a2de73d23c6580523de8c810b5a10a194b
2022-04-17 23:21:19 +02:00
Dominik Riebeling
37a60d5461 rbutil: Enable themes install depending on theme selection.
Don't store the "Install Themes" option. Automatically enable themes
installation if the themes selection has at least one entry selected
instead.

Change-Id: Ib46e8b53b0204555b79dea51545dd7c380f003ff
2022-04-17 23:21:19 +02:00
Dominik Riebeling
62108a9613 rbutil: Use references to avoid creating temporary objects.
Get rid of some unnecessary object creating / copying by using
references.

Change-Id: Ia44e34f6f66d230caa9af7ef7c0eca73be12de2a
2022-04-17 23:21:19 +02:00
Dominik Riebeling
8c55ce62b9 rbutil: Move bootloader file check to base class.
Avoid constructing the bootloader file path in the caller. Pass filename
list and mountpoint separately so it can directly fall back to the
mountpoint.

Change some functions to use references instead of creating temporary
objects.

Change-Id: I09c9d755553a32de3d02a42a8ce1fcb94f831b2a
2022-04-17 23:21:19 +02:00
Aidan MacDonald
1af92e5ff8 Fix red from 6f5af8e53c
Change-Id: I02dbc3e91856eaef081446ca77919e6182a85e1d
2022-04-17 17:21:02 +01:00
Aidan MacDonald
fca7b8e2ff Fix undefined behavior that blocks compiling with UBSan
Left shifts are not defined in C if they would cause signed overflow,
so these expressions get instrumented, which makes them unusable as
switch values and triggers compile errors when compiling with UBSan.

Change-Id: I0588d4be1e00ba1cfde0eac119ead368b20d10c9
2022-04-17 11:37:34 -04:00
Aidan MacDonald
c6df8cc4f7 configure: Add support for compiling the simulator with UBSan
By passing --with-ubsan to tools/configure, you can now build the
simulator with UBSan to catch undefined behavior at runtime.

Change-Id: I054cd46ca59587dd544efbd7bdf6d27a040a4891
2022-04-17 11:37:34 -04:00
Christian Soffke
6f5af8e53c Add Codec to Track Info screen
Change-Id: Ieec0e49d0b5e1ca14fa828a510edf30d548969b2
2022-04-17 11:32:13 -04:00
William Wilgus
c4156b1909 viewports, set flags to VP_DEFAULT_FLAGS
flags were getting un-initialized memory
it really didn't matter with the flags getting initialized
anyway
But once I added a new flag that didn't explicitly
set or clear the flag at init well here we are

set flags to VP_DEFAULT_FLAGS in viewport_set_defaults()

add the flags variable to the default vp's set to 0
(it was already initialized to 0 by bss, make it explicit)

Change-Id: I3a9a062455b4cf66d2b8c70fdf05402a5c0c091c
2022-04-17 10:59:56 -04:00
Christian Soffke
6703f43f5c Playlist Viewer: Always retrieve track Info from disk
Frequency, file size, and the codec are not stored
in the database and thus can’t be displayed in the
Playlist Viewer's Track Info screen when metadata
is only retrieved from the database.

Change-Id: I9e1d11c13ad8bf7b90b654ed78e4e7f763c30f8a
2022-04-17 10:58:42 -04:00
Aidan MacDonald
0e8f3669d0 Fix remaining red from 3fcdadce24
Change-Id: I619a637bdf1fb932c3618f1f40aaa1c9e7f98300
2022-04-16 16:06:13 +01:00
Aidan MacDonald
76035decc6 Fix red in 3fcdadce24
Change-Id: Idbee52505b3c109a0aad23e2edf7dd78519eb173
2022-04-16 10:41:19 -04:00
Christian Soffke
f989339664 Remove dead code
Change-Id: If31a99e6488dabab47d482637b2609ff829df1ca
2022-04-16 10:18:28 -04:00
Christian Soffke
68ac932585 PictureFlow: Disable 'Album Not Found' splash when stopped
...and go to last album, even if it hadn't
been selected for playback

Change-Id: I44013e930a1feb873f128c2885ecb8ddaf4ae3ff
2022-04-16 10:13:50 -04:00
Christian Soffke
e3bf6f08e3 PictureFlow: Delay LCD Update until center slide is loaded
Eliminates flashing of slide right after launch or
when changing sorting on the M3K using the
volume buttons

Change-Id: Icd317e0b0d5b939269dc8dafd30d0c0f9daa5fd9
2022-04-16 10:13:50 -04:00
Aidan MacDonald
3fcdadce24 plugins: Add multiboot select plugin
This plugin provides a menu for easily editing the root redirect file
on targets that support multiboot. You can select a new root from a
list of Rockbox installations detected on the filesystem or remove all
redirects to boot from the default location.

To avoid searching the whole filesystem, only subdirectories of the
volume roots are checked for valid installations. Only installations
that are compatible with the current player will be displayed.

Change-Id: I7dcbadfd97873b87817870e61d2ae37956d2da00
2022-04-16 14:36:39 +01:00
Aidan MacDonald
d55dceff37 apps: Add ability to do a clean reboot
Allow a clean shutdown to end in either power off or reboot. Add a
new event SYS_REBOOT to signal it and sys_reboot() to trigger the
event. SYS_REBOOT signals a reboot request and should be listened
for alongside SYS_POWEROFF events.

Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2022-04-16 14:36:39 +01:00
Dominik Riebeling
90960adf56 rbutil: Fix bootloader installation for various players.
Reworking handling of player specific data (static player configuration,
as well as information retrieved from the server) changed the behaviour
on a non-present configuration entry. This eventually caused the
mountpoint not being set for players that don't have a bootloader file
on disk. Fixing this accidentially removed the default-if-not-found
handling for the bootloader file.

Restore the old default value behaviour for both cases.

Change-Id: I627782ccdef198619fb507f8b09a64811b3bd18f
2022-04-15 21:03:44 +02:00
William Wilgus
ff08841ea9 viewport FIX RED remote screens
Change-Id: I894a5c3e9053f44dee4803e9cdbbcb8f651ee318
2022-04-15 08:16:28 -04:00
William Wilgus
d56d96031c viewports add flag to disable updates
when drwing multiple areas of the screen with other gui elements
you might want to combine updates into a single screen redraw

Change-Id: Ie4130366fa13e25d3d14e937257d11547dd61134
2022-04-15 01:54:42 -04:00
Dominik Riebeling
b9c3ab2e04 rbutil: Improve progress & responsiveness on (un)install.
- When uninstalling update the log file only at the end of removing all
  files. This gives a major speed improveness since othewise the log
  file is written after each file. This slows down things notably,
  especially on slow disks.
- Explicitly update the UI during install zip extraction. Avoids
  progress seemingly hanging due to the UI not getting updated often
  enough.

Change-Id: Ib353a92e02a7038d6e55f5f88dcfb5085602c0f2
2022-04-14 23:06:40 +02:00
Dominik Riebeling
97176d444e rbutil: Use progress bar on uninstall.
When uninstalling parts with lots of small files the process can take
quite some time. Update the progress accordingly.

Change-Id: Iecc4553b36abbc1cf9652a325ccb29b62a7fc4cc
2022-04-14 22:37:45 +02:00
Dominik Riebeling
6ef094c1a9 rbutil: Make QtMultimedia an optional component.
We only use it for playing the TTS sample so it's not too important.
Since this is a separate Qt module it might not be installed, so make it
optional.

Change-Id: I2c91dd5d587c8a984525b2297bbe7d597b816b4f
2022-04-14 22:23:35 +02:00
Dominik Riebeling
8a6ceff376 rbutil: Fix sansapatcher bootloader install on Windows.
During bootloader installation sansapatcher disk access is accidentially
set up twice. This is not a problem except on Windows, which will abort
with a "permission denied" error.

This is basically the same problem as for ipodpatcher bootloader install.

Change-Id: I03220e17d0e00a15fff23c02aba7da93d4781964
2022-04-14 22:22:46 +02:00
Dominik Riebeling
cc2f364926 rbutil: Fix ipodpatcher bootloader install on Windows.
During bootloader installation ipodpatcher disk access is accidentially
set up twice. This is not a problem except on Windows, which will abort
with a "permission denied" error.

Change-Id: I9a835ef0d49f24df741b7b2909c4bd87cb1c8341
2022-04-13 21:36:44 +02:00
William Wilgus
b9ab75732a bitmap/list.c fix red
--typo

Change-Id: Iaa632e215d7d1e3758f62fedd72565fa633d925e
2022-04-10 23:59:33 -04:00
William Wilgus
ddcab156f7 gui_synclist move global display settings to list struct
its really painful needing to override global settings in order to change
some aspects of lists

this patch moves:

[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]

to variables within the synclist, it also makes updating
after settings changes a necessity

I think I have the static synclists in core covered

(I think the one in gui/list-skinned can be left as is)

this patch allows easy modification these flags on the fly

Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
2022-04-10 22:24:28 -04:00
Aidan MacDonald
8dbc0914f6 imageviewer: limit progress bar LCD update rate
The progress callback doesn't rate limit LCD updates, which causes
excessive slowdowns (up to 150x!) on some targets. Limiting updates
to 20fps solves the problem and should boost load speed across the
board, particularly for large images and animated GIFs that may run
the progress callback thousands of times.

Change-Id: Ia48924d4dcb24c1111509329581809be494d0165
2022-04-09 23:15:48 +01:00
Aidan MacDonald
32f1418c5a buffering: fix buffer overflows with bitmap loading
In some circumstances it was possible for a bitmap to overflow its
buffer and overwrite the next handle. The easiest way to trigger it
is with a highly compressed JPEG that is decoded to a large bitmap.
Because the JPEG file size is used to determine how much to allocate
this would cause an obvious buffer overflow when the JPEG is smaller
than the decoded bitmap. Fix this by using the decoded bitmap size as
the allocation size. Some overhead must be added to deal with JPEGs,
but it will be freed once the image is loaded.

A less obvious possibility is the fact that add_handle() will allow
a handle to be added even if there's not enough space for the entire
allocation. This is generally beneficial because it allows the first
part of a file to be loaded while waiting for space to free up, but
for bitmaps it is not valid because the whole image is loaded at once.
Hence if there is not actually enough space in the buffer, the bitmap
load can again overflow the actual free space and overwrite the next
handle.

The buffering code supports an H_ALLOCALL flag for allocations that
need the free space available immediately, so use it for bitmaps to
avoid that bug.

load_image() had a sketchy-looking check for free space which stopped
me from triggering the bug with simple tests, but since guessing the
free space is obviously a bad idea when the caller *knows* how much
free space there really is, remove that guess and let the caller tell
load_image() the real deal.

Change-Id: If62a58759705d83c16ee5b50f26bcbccc3f6c01f
2022-04-09 15:20:57 +01:00
Aidan MacDonald
5aa0fc3b00 jpeg: provide a rough estimate of decoder memory overhead
JPEG decoding requires additional space in the bitmap buffer beyond
what is needed for the decoded pixel data. Provide a way to estimate
how much overhead is needed.

The actual overhead is sizeof(struct jpeg) + decode_buf_size, where
the latter depends on the image size and JPEG encoding used. From my
testing decode_buf_size is normally pretty small (under 5 KiB) but
looking at the code it could be large in some cases, primarily with
large images, so 32 KiB seems to be a decent compromise. Someone who
knows better about JPEG should pick a better value if that's too big.

Using a constant is obviously not the most accurate but it seems to
be the simplest option for retrofitting to existing code.

Change-Id: I573b0abb8ca2d79e43f185010487f07226edb793
2022-04-09 15:20:57 +01:00
Aidan MacDonald
7718b24401 buffering: fix signed overflow in next_handle_id()
Not sure what the comment is talking about - signed overflow
is undefined behavior and we don't use -fwrapv or other flags
to make it defined. I can't see how a compiler could abuse it
here, but the overflow is nonetheless easily avoided.

Change-Id: Ibed6d7c0d841db2aa86b9d8ba4c6a0d08c413354
2022-04-09 15:20:57 +01:00