• src/doors/termgfx/audio_mgr.c audio_mgr.h

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Jul 9 01:55:11 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/35961c8931362fcc6d940d19
    Modified Files:
    src/doors/termgfx/audio_mgr.c audio_mgr.h
    Log Message:
    termgfx: add name-addressed SFX (store + play_named)

    The SFX pair keys its client-cache name on the caller's id ("<prefix>/sfx/<id>", audio_mgr.c's snprintf(leaf, "%d", id)) and Stores lazily, inside the play call, guarded by sfx_up[id]. Neither an eager
    Store nor a caller-supplied name is expressible, and syncmoo1 needs both:
    1oom registers every sample up front, before the audio tier is even
    known, and content-addressed names are what let a later cross-session
    upload skip be correct.

    Add termgfx_audio_sfx_store() and termgfx_audio_sfx_play_named(), keyed
    on a caller-supplied leaf with their own "Stored this session" table.
    The transcode-and-Store body is extracted to sfx_store_bytes() and shared
    with the id path, whose sfx_up[]/sfx_dur[] behaviour is unchanged.

    Additive: SyncDOOM and SyncDuke keep the id path byte-for-byte and both
    still build.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thu Jul 9 01:55:11 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/5ada5ab247cf590c48934f6f
    Modified Files:
    src/doors/termgfx/audio_mgr.c audio_mgr.h
    Log Message:
    termgfx_audio: reject over-long SFX cache names instead of
    truncating

    termgfx_audio_sfx_store() and _play_named() key a per-session
    table on a caller-supplied leaf name (a content hash, e.g.
    "s_<fnv1a8>"). The table stores leaves in a fixed 16-byte field
    copied via strncpy(), silently truncating longer leaves. When
    _play_named() later searches for the full leaf with strcmp(), it
    never matches the truncated stored copy -- the sample never
    plays.

    Add length checks to both functions' early-return guards so an
    over-long leaf is rejected (stores nothing, plays nothing) rather
    than half-stored under a name that can never be found again. Also
    replace strncpy() + manual NUL with snprintf() for clarity, and
    document the 16-byte constraint on the header declarations (the
    leaf must be shorter than NAMEDLEN, which is 16 bytes).

    Current callers use "s_<8-hex>" (10 chars), so they're unaffected.
    A future wider hash or longer name prefix would have hit this
    silently without the length check; it now fails cleanly.

    Test: all three doors (syncdoom/syncduke/syncmoo1) still build,
    and syncmoo1's unit tests (test_map, test_audio) both pass.

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net