diff --git a/src/Formats/audio/ape/init.luau b/src/Formats/audio/ape/init.luau index a165f79..72d25dc 100644 --- a/src/Formats/audio/ape/init.luau +++ b/src/Formats/audio/ape/init.luau @@ -89,7 +89,7 @@ function Ape.open(r: Bytes.Reader, opts: OpenOptions?): (Types.Decoder?, Err.Err if not info then return nil, err end - if info.channels * info.blocksPerFrame > 2 ^ 26 then + if info.channels * info.blocksPerFrame > 2 ^ 24 then return nil, Err.new(Err.LIMIT, "frames of " .. info.blocksPerFrame .. " blocks") end local codec, cerr = ApeCodec.decoder(info) diff --git a/src/Formats/audio/tta/init.luau b/src/Formats/audio/tta/init.luau index e0e9d88..63d197f 100644 --- a/src/Formats/audio/tta/init.luau +++ b/src/Formats/audio/tta/init.luau @@ -85,7 +85,7 @@ function Tta.open(r: Bytes.Reader, opts: OpenOptions?): (Types.Decoder?, Err.Err if not info then return nil, err end - if info.channels * info.frameLength > 2 ^ 26 then + if info.channels * info.frameLength > 2 ^ 24 then return nil, Err.new(Err.LIMIT, info.channels .. " channels of " .. info.frameLength .. "-sample frames") end local codec = TtaCodec.decoder(info, stop) diff --git a/src/Formats/codecs/audio/WavPack/init.luau b/src/Formats/codecs/audio/WavPack/init.luau index cf3eb30..e774a5f 100644 --- a/src/Formats/codecs/audio/WavPack/init.luau +++ b/src/Formats/codecs/audio/WavPack/init.luau @@ -191,6 +191,9 @@ local function frame(self: Decoder, buf: buffer, blocks: { number }, cbuf: buffe end if n < 0 then n = h.samples + if n * C > 16777216 then + return nil, Err.new(Err.LIMIT, "a frame of " .. n .. " samples x " .. C .. " channels", at) + end if #self.pcm < n * C then self.pcm = table.create(n * C, 0) end