anacrolix / dms

A UPnP DLNA Digital Media Server that includes basic video transcoding. Tested on a Panasonic Viera television, several Android UPnP apps, and Chromecast.
BSD 3-Clause "New" or "Revised" License
637 stars 97 forks source link

ssdp panic while caltulating delay time #123

Closed qzhsjz closed 1 year ago

qzhsjz commented 1 year ago

panic: invalid argument to Int63n

goroutine 3806 [running]: math/rand.(Rand).Int63n(0x140005d0140?, 0x14001058890?) /opt/homebrew/opt/go/libexec/src/math/rand/rand.go:121 +0xe8 math/rand.Int63n(...) /opt/homebrew/opt/go/libexec/src/math/rand/rand.go:348 github.com/anacrolix/dms/ssdp.(Server).handle(0x140005d0140, {0x140012dd200, 0x65, 0x5dc}, 0x140005381b0?) /Users/*/go/pkg/mod/github.com/anacrolix/dms@v1.6.0/ssdp/ssdp.go:319 +0x874 created by github.com/anacrolix/dms/ssdp.(Server).serve /Users//go/pkg/mod/github.com/anacrolix/dms@v1.6.0/ssdp/ssdp.go:129 +0x2c

qzhsjz commented 1 year ago
图片

This is because some clients report the mx value 0.

anacrolix commented 1 year ago

Fixed by https://github.com/anacrolix/dms/pull/124, thank you very much for the contribution.