jensandClaude Sonnet 5 a65b71ab86 Fix critical memory-safety and concurrency bugs found in code review
- handleController: bounds-check NRPN/CC controller ID before indexing
  last_midiCC_info[] (NRPN IDs can reach 16383, array is sized 1024)
- JaySynthMidiCC::add/remove: also reject negative controller IDs coming
  from patch/bank file data, not just out-of-range-high ones
- bankImportXml/loadPatchFromFile: null-check XML elements after
  getFirstChildElement()/XmlDocument::parse() before dereferencing, so
  malformed/truncated patch or bank files no longer crash on load
- loadBankFromFile/loadPatchFromFile: validate the loaded file is large
  enough for the fxBank/fxProgram header, and that the embedded chunk
  size fits within the file, before reading through the raw pointer
- processBlock/JaySynth::renderNextBlock: host blocks larger than
  SYNTH_MAX_BUFSIZE no longer overflow the fixed-size stack work buffers
  or deadlock the render worker threads; oversized blocks are now
  rendered in multiple SYNTH_MAX_BUFSIZE-sized passes (pending MIDI
  events are correctly held over between passes)
- JaySynth constructor: guard against createInputStream() returning null
  when the wavetable file can't be opened
- JaySynth::setParameter/setControl/setPerVoiceControl/setParam/
  ClearControls: take the synth's lock, matching renderNextBlock and the
  note/controller handlers, to close a data race between parameter
  changes (UI/host automation) and audio-thread rendering

Verified with a full rebuild (make) producing JaySynth.so with no new
warnings or errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dhtwRLARk4eiPngcQykLJ
2026-07-27 17:22:46 +02:00
2025-08-21 07:52:16 +02:00
2025-08-06 22:08:46 +02:00
2025-08-03 10:57:01 +02:00
2026-05-09 08:29:00 +02:00
2025-08-03 10:57:01 +02:00
2025-08-08 13:54:08 +02:00
2026-05-09 08:37:16 +02:00
2025-07-29 20:43:25 +02:00
2015-03-20 16:35:58 +00:00
2026-05-09 08:34:24 +02:00
2023-04-26 22:01:57 +02:00
2014-10-25 07:27:55 +00:00
S
Description
No description provided
90 MiB
Languages
C++ 53.7%
C 36.8%
Makefile 4.1%
MATLAB 2.2%
Roff 1.6%
Other 1.6%