From 727f1399a91648f9bb2bab400962ed99a1962bda Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 29 Jul 2023 14:29:00 +0800 Subject: Bugfix: failed to parse `DANMU_MSG` messages --- danmaku/dmmsg/danmu.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/danmaku/dmmsg/danmu.go b/danmaku/dmmsg/danmu.go index f0229d2..a18a9aa 100644 --- a/danmaku/dmmsg/danmu.go +++ b/danmaku/dmmsg/danmu.go @@ -26,8 +26,8 @@ func (dm DanMuMessage) String() string { const InvalidDanmakuJson = "invalid danmaku JSON document" func ParseDanmakuMessage(body RawDanMuMessage) (dmm DanMuMessage, err error) { - if len(body.Info) != 16 { - err = fmt.Errorf("%s: \"info\" length != 16", InvalidDanmakuJson) + if len(body.Info) < 16 { + err = fmt.Errorf("%s: \"info\" length < 16", InvalidDanmakuJson) return } -- cgit v1.2.3