Various fixes #151

Merged
OragonEfreet merged 5 commits from oragonefreet-patch-1 into release/1.0 2026-06-03 20:45:48 +02:00
Owner

Various fixes

Various fixes
fix(bitmap): handle INT32_MIN safely in LOCAL_ABS macro (#143)
Some checks failed
Documentation / build-docs (pull_request) Successful in 8s
Build and Test / linux-linux-gcc / shared (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / static (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / shared (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / static (pull_request) Has been cancelled
QA / cert (pull_request) Has been cancelled
1ae3a2aafe
Fix undefined behavior when negating INT32_MIN by using unsigned
arithmetic instead. The old macro `(uint32_t)(-(x))` would invoke
UB when x is INT32_MIN because -INT32_MIN overflows int32_t.

The new approach casts to uint32_t first, then uses unsigned
subtraction: `(uint32_t)0 - (uint32_t)(x)`, which is well-defined.

Reviewed-on: #143
fix(physics): guard against division by zero in point gravity (#144)
Some checks failed
QA / cert (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / shared (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / static (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / shared (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / static (pull_request) Has been cancelled
Documentation / build-docs (pull_request) Has been cancelled
507a4336a5
Add checks for zero inverse_mass (infinite mass) before computing
gravitational force. Particles with infinite mass should not have
gravity forces applied to them, and division by zero inverse_mass
would cause undefined behavior.

Affects:
- bj_apply_point_gravity_2d
- bj_apply_point_gravity_softened_2d

Reviewed-on: #144
fix(bitmap): add overflow check for buffer size calculation (#148)
Some checks failed
QA / cert (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / shared (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / static (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / shared (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / static (pull_request) Has been cancelled
Documentation / build-docs (pull_request) Has been cancelled
47757398ea
Add overflow check before computing stride * height to prevent
integer overflow when allocating bitmap buffer. On systems where
size_t is 32-bit, large dimensions could overflow and cause
undersized buffer allocation.

Reviewed-on: #148
fix(audio): check pthread_create return in ALSA backend (#149)
Some checks failed
QA / cert (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / shared (pull_request) Has been cancelled
Build and Test / linux-linux-gcc / static (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / shared (pull_request) Has been cancelled
Build and Test / linux-windows-mingw / static (pull_request) Has been cancelled
Documentation / build-docs (pull_request) Has been cancelled
2e7c5bd268
Add error checking for pthread_create() in alsa_open_device().
Previously, if thread creation failed, the device would be returned
as if successfully initialized, leading to a broken audio device.

Also adds null check for audio buffer allocation.

Reviewed-on: #149
fix(net): add null checks after allocation in network code (#150)
All checks were successful
Documentation / build-docs (pull_request) Successful in 8s
QA / cert (pull_request) Successful in 29s
Build and Test / linux-linux-gcc / shared (pull_request) Successful in 16s
Build and Test / linux-linux-gcc / static (pull_request) Successful in 17s
Build and Test / linux-windows-mingw / shared (pull_request) Successful in 25s
Build and Test / linux-windows-mingw / static (pull_request) Successful in 27s
Documentation / build-docs (push) Successful in 8s
QA / cert (push) Successful in 29s
Build and Test / linux-linux-gcc / shared (push) Successful in 16s
Build and Test / linux-linux-gcc / static (push) Successful in 17s
Build and Test / linux-windows-mingw / shared (push) Successful in 26s
Build and Test / linux-windows-mingw / static (push) Successful in 25s
74de3b4bb1
Add null checks after all bj_calloc() calls in both POSIX and Win32
network implementations. Previously, allocation failures would cause
null pointer dereferences. Now properly sets error and returns NULL,
with appropriate resource cleanup (closing sockets, freeing addrinfo).

Affected functions:
- bj_resolve_address
- bj_listen_tcp
- bj_connect_tcp
- bj_connect_tcp_to
- bj_accept_tcp
- bj_open_udp
- bj_udp_recv

Reviewed-on: #150
OragonEfreet changed title from fix(bitmap): handle INT32_MIN safely in LOCAL_ABS macro (#143) to Various fixes 2026-06-03 20:43:51 +02:00
OragonEfreet merged commit 74de3b4bb1 into release/1.0 2026-06-03 20:45:48 +02:00
OragonEfreet deleted branch oragonefreet-patch-1 2026-06-03 20:45:48 +02:00
OragonEfreet added this to the 1.0 milestone 2026-06-04 19:46:08 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OragonEfreet/banjo!151
No description provided.