diff --git a/codec/mjpeg/jpeg.go b/codec/mjpeg/jpeg.go index cfe0c17a..4d127bfc 100644 --- a/codec/mjpeg/jpeg.go +++ b/codec/mjpeg/jpeg.go @@ -280,9 +280,7 @@ func (c *Context) ParsePayload(p []byte, m bool) error { // Write frame data rem := len(p) - f := p[idx:rem] - copy(c.buf[c.blen:], f) - c.blen += len(f) + c.blen += copy(c.buf[c.blen:], p[idx:rem]) idx += rem if m {