1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-04-27 13:48:56 +08:00

Merge pull request #631 from eleniums/fix/tello-read-udp-panic

Fix slice bounds out of range panic when stopping Tello drone
This commit is contained in:
Ron Evans 2018-10-12 01:41:57 +02:00 committed by GitHub
commit d0f5ba5010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -816,11 +816,12 @@ func (d *Driver) processVideo() error {
for {
buf := make([]byte, 2048)
n, _, err := d.videoConn.ReadFromUDP(buf)
d.Publish(d.Event(VideoFrameEvent), buf[2:n])
if err != nil {
fmt.Println("Error: ", err)
continue
}
d.Publish(d.Event(VideoFrameEvent), buf[2:n])
}
}()