Skip to content
This repository was archived by the owner on Feb 10, 2026. It is now read-only.

Commit 4245767

Browse files
authored
fix for partly uninitialized sound sync packets (audioreactive)
audioSyncPacket contains four "invisible" padding bytes added by the compiler. These need to be initialized to zero, as future versions of the protocol will make use of these fields.
1 parent 74d196a commit 4245767

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

usermods/audioreactive/audio_reactive.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,8 @@ class AudioReactive : public Usermod {
960960
//DEBUGSR_PRINTLN("Transmitting UDP Mic Packet");
961961

962962
audioSyncPacket transmitData;
963+
memset(reinterpret_cast<void *>(&transmitData), 0, sizeof(transmitData)); // make sure that the packet - including "invisible" padding bytes added by the compiler - is fully initialized
964+
963965
strncpy_P(transmitData.header, PSTR(UDP_SYNC_HEADER), 6);
964966
// transmit samples that were not modified by limitSampleDynamics()
965967
transmitData.sampleRaw = (soundAgc) ? rawSampleAgc: sampleRaw;

0 commit comments

Comments
 (0)