Add unit test to scaleDecode

This commit is contained in:
Nicholas Thompson
2020-09-13 16:49:02 +02:00
parent 2a56dd24e4
commit 4c6df96051
2 changed files with 66 additions and 57 deletions

View File

@@ -235,7 +235,7 @@ func (m *mk2Ser) reqScaleFactor(in byte) {
// Decode the scale factor frame.
func (m *mk2Ser) scaleDecode(frame []byte) {
tmp := scaling{}
if len(frame) <= 2 {
if len(frame) < 6 {
tmp.supported = false
logrus.Warnf("Skiping scaling factors for: %d", m.scaleCount)
} else {