Skip to content

support for macos#160

Open
i-infra wants to merge 6 commits into
Guenael:mainfrom
i-infra:main
Open

support for macos#160
i-infra wants to merge 6 commits into
Guenael:mainfrom
i-infra:main

Conversation

@i-infra

@i-infra i-infra commented Apr 1, 2026

Copy link
Copy Markdown

Tested on aarch64 macos, need to test on x86_64 ubuntu still, but should be fine. Fixes some lint, moves some variables from stack to heap, and fixes libcurl init. Throws bus error on attempted decode without these patches.

@Guenael

Guenael commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Hi,
Why do you believe this patch is necessary, and how, precisely, will it be beneficial?

-   for (uint32_t i = 0; i < samples_count; i += 8) {
+   for (uint32_t i = 0; i + 7 < samples_count; i += 8) {

@i-infra

i-infra commented Apr 25, 2026

Copy link
Copy Markdown
Author

Hi, Why do you believe this patch is necessary, and how, precisely, will it be beneficial?

-   for (uint32_t i = 0; i < samples_count; i += 8) {
+   for (uint32_t i = 0; i + 7 < samples_count; i += 8) {

If the rtl_sdr returns a sequence of data that's not a multiple of 8, ie transfer is interrupted & partial buffer submitted, the following buffer manipulations could out-of-bounds index. This just guards against the case that samples_count % 8 != 0 which was flagged by building on MacOS. Can add a comment, or move to a different commit if you'd like!

Also, forgot that I had this PR open - sorry for the delay, and sorry for the other commits - I'd like to at least ensure upstream builds cleanly on MacOS, so please let me know if you'd like me to re-open the PR with just the MacOS fixes cherry-picked, as the debug logging for decodes on this branch as well as the rename from ".iq" to ".cu8" and ".cf32" are independently useful but not related to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants