mirror of
https://github.com/logos-storage/nim-leopard.git
synced 2026-01-02 13:43:08 +00:00
check that parity and data buffers are < 65536
This commit is contained in:
parent
93a3bbcde2
commit
d85bb31062
@ -73,7 +73,7 @@ func encode*(
|
||||
|
||||
let
|
||||
res = leoEncode(
|
||||
self.bufSize.cuint,
|
||||
self.bufSize.culonglong,
|
||||
self.buffers.cuint,
|
||||
self.parity.cuint,
|
||||
self.workBufferCount.cuint,
|
||||
@ -144,7 +144,7 @@ func decode*(
|
||||
|
||||
let
|
||||
res = leo_decode(
|
||||
self.bufSize.cuint,
|
||||
self.bufSize.culonglong,
|
||||
self.buffers.cuint,
|
||||
self.parity.cuint,
|
||||
self.decodeBufferCount.cuint,
|
||||
@ -206,6 +206,9 @@ proc init[TT: Leo](
|
||||
if parity > buffers:
|
||||
return err("number of parity buffers cannot exceed number of data buffers!")
|
||||
|
||||
if buffers + parity > 65536:
|
||||
return err("number of parity and data buffers cannot exceed 65536!")
|
||||
|
||||
once:
|
||||
# First, attempt to init the leopard library,
|
||||
# this happens only once for all threads and
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user