aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/JSBuffer.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-08-19 18:17:16 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-19 18:17:16 -0700
commit507761b4637a83d10e2f8b64ff870881bba7c14b (patch)
treecb3a2920ed18832df3c7075bd8e21b15b1184a3d /src/bun.js/bindings/JSBuffer.cpp
parent196620183fd20ca42b363c5f947af1dc979f888f (diff)
downloadbun-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.cpp2
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);
}));