diff options
author | 2023-08-19 18:17:16 -0700 | |
---|---|---|
committer | 2023-08-19 18:17:16 -0700 | |
commit | 507761b4637a83d10e2f8b64ff870881bba7c14b (patch) | |
tree | cb3a2920ed18832df3c7075bd8e21b15b1184a3d /src/bun.js/bindings/JSBuffer.cpp | |
parent | 196620183fd20ca42b363c5f947af1dc979f888f (diff) | |
download | bun-507761b4637a83d10e2f8b64ff870881bba7c14b.tar.gz bun-507761b4637a83d10e2f8b64ff870881bba7c14b.tar.zst bun-507761b4637a83d10e2f8b64ff870881bba7c14b.zip |
Fix crash impacting sharp & resvg (#4221)
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/JSBuffer.cpp')
-rw-r--r-- | src/bun.js/bindings/JSBuffer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp index 16c0e64b6..934fc9b6c 100644 --- a/src/bun.js/bindings/JSBuffer.cpp +++ b/src/bun.js/bindings/JSBuffer.cpp @@ -202,7 +202,7 @@ JSC::EncodedJSValue JSBuffer__bufferFromPointerAndLengthAndDeinit(JSC::JSGlobalO auto* subclassStructure = globalObject->JSBufferSubclassStructure(); if (LIKELY(length > 0)) { - auto buffer = ArrayBuffer::createFromBytes(ptr, length, createSharedTask<void(void*)>([=](void* p) { + auto buffer = ArrayBuffer::createFromBytes(ptr, length, createSharedTask<void(void*)>([ctx, bytesDeallocator](void* p) { if (bytesDeallocator) bytesDeallocator(p, ctx); })); |