File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -734,17 +734,17 @@ class BMP
734734// Convert object from Javascript to a C++ class (BMP).
735735BMP buildBMP (Local<Object> info)
736736{
737- Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked ();
738-
737+ char * buf = NULL ;
739738 BMP img;
739+ Local<Object> obj = Nan::To<v8::Object>(info).ToLocalChecked ();
740740
741741 img.width = obj->Get (Nan::New (" width" ).ToLocalChecked ())->Uint32Value ();
742742 img.height = obj->Get (Nan::New (" height" ).ToLocalChecked ())->Uint32Value ();
743743 img.byteWidth = obj->Get (Nan::New (" byteWidth" ).ToLocalChecked ())->Uint32Value ();
744744 img.bitsPerPixel = obj->Get (Nan::New (" bitsPerPixel" ).ToLocalChecked ())->Uint32Value ();
745745 img.bytesPerPixel = obj->Get (Nan::New (" bytesPerPixel" ).ToLocalChecked ())->Uint32Value ();
746746
747- char * buf = node::Buffer::Data (obj->Get (Nan::New (" image" ).ToLocalChecked ()));
747+ buf = node::Buffer::Data (obj->Get (Nan::New (" image" ).ToLocalChecked ()));
748748
749749 // Convert the buffer to a uint8_t which createMMBitmap requires.
750750 img.image = (uint8_t *)malloc (img.byteWidth * img.height );
You can’t perform that action at this time.
0 commit comments