Skip to content

Commit cb76f5e

Browse files
committed
Correct buffer size.
1 parent bb2ab38 commit cb76f5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/robotjs.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ NAN_METHOD(captureScreen)
673673

674674
MMBitmapRef bitmap = copyMMBitmapFromDisplayInRect(MMRectMake(x, y, w, h));
675675

676-
uint32_t bufferSize = bitmap->bytesPerPixel * bitmap->width * bitmap->height;
676+
uint32_t bufferSize = bitmap->bytewidth * bitmap->height;
677677
Local<Object> buffer = Nan::NewBuffer((char*)bitmap->imageBuffer, bufferSize, destroyMMBitmapBuffer, NULL).ToLocalChecked();
678678

679679
Local<Object> obj = Nan::New<Object>();

0 commit comments

Comments
 (0)