check channel and value data before sending

This commit is contained in:
Adrian Baumgart 2024-05-09 01:03:27 +02:00
parent f36cc53be1
commit 8e3d303e51
No known key found for this signature in database

View File

@ -65,8 +65,10 @@ export default class ConvertHandler {
this.usbdmxInCounter++; this.usbdmxInCounter++;
if (this.outputAllowed) { if (this.outputAllowed) {
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
if ((startChannel + i) >= 0 && (startChannel + i) < 512 && data[i] >= 0 && data[i] < 256) {
this.artNetSender.prepChannel(startChannel + i, data[i]); this.artNetSender.prepChannel(startChannel + i, data[i]);
} }
}
this.artnetOutCounter++; this.artnetOutCounter++;
this.artNetSender.transmit(); this.artNetSender.transmit();
} }