Fix AutoLightsColorRefreshColor calling SetColor with an incomplete array.
This could cause access violations, because it calls the native SMX_SetColor with a color array that's too small.
This commit is contained in:
parent
4c0da63842
commit
bceca77016
@ -320,16 +320,16 @@ namespace smx_config
|
||||
|
||||
private void AutoLightsColorRefreshColor()
|
||||
{
|
||||
byte[] lights = new byte[864];
|
||||
CommandBuffer cmd = new CommandBuffer();
|
||||
|
||||
for(int pad = 0; pad < 2; ++pad)
|
||||
{
|
||||
// Use this panel's color. If a panel isn't connected, we still need to run the
|
||||
// loop below to insert data for the panel.
|
||||
byte[] color = new byte[9*3];
|
||||
SMX.SMXConfig config;
|
||||
if(!SMX.SMX.GetConfig(pad, out config))
|
||||
continue;
|
||||
|
||||
byte[] color = config.stepColor;
|
||||
if(SMX.SMX.GetConfig(pad, out config))
|
||||
color = config.stepColor;
|
||||
for( int iPanel = 0; iPanel < 9; ++iPanel )
|
||||
{
|
||||
for( int i = 0; i < 16; ++i )
|
||||
|
@ -414,6 +414,9 @@ namespace SMX
|
||||
public static void SetLights(byte[] buf)
|
||||
{
|
||||
if(!DLLAvailable()) return;
|
||||
|
||||
if(buf.Length != 9*16*3*2)
|
||||
throw new Exception("SetLights buffer has an invalid length: " + buf.Length);
|
||||
SMX_SetLights(buf);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user