Browse Source

misc fixes

v1.x
Tj Holowaychuk 14 years ago
parent
commit
3dc34e41e5
  1. 6
      src/PixelArray.cc

6
src/PixelArray.cc

@ -80,7 +80,8 @@ PixelArray::New(const Arguments &args) {
Handle<Value> Handle<Value>
PixelArray::GetLength(Local<String> prop, const AccessorInfo &info) { PixelArray::GetLength(Local<String> prop, const AccessorInfo &info) {
return Number::New(info.This()->GetIndexedPropertiesPixelDataLength()); HandleScope scope;
return scope.Close(Number::New(info.This()->GetIndexedPropertiesPixelDataLength()));
} }
/* /*
@ -133,8 +134,7 @@ PixelArray::PixelArray(int width, int height):
uint8_t * uint8_t *
PixelArray::alloc() { PixelArray::alloc() {
int len = length(); int len = length();
_data = (uint8_t *) malloc(len); _data = (uint8_t *) calloc(1, len);
memset(_data, 0, len);
V8::AdjustAmountOfExternalAllocatedMemory(len); V8::AdjustAmountOfExternalAllocatedMemory(len);
return _data; return _data;
} }

Loading…
Cancel
Save