| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 99dbf4dd5de8c0ddbfaee4db008cbf89e1b003c8..2e0b9f59c6245df8f91fac976d6087e3d8616d94 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -3401,7 +3401,7 @@ void v8::Object::SetIndexedPropertiesToPixelData(uint8_t* data, int length) {
|
| ON_BAILOUT(isolate, "v8::SetElementsToPixelData()", return);
|
| ENTER_V8(isolate);
|
| i::HandleScope scope(isolate);
|
| - if (!ApiCheck(length <= i::ExternalPixelArray::kMaxLength,
|
| + if (!ApiCheck(length >= 0 && length <= i::ExternalPixelArray::kMaxLength,
|
| "v8::Object::SetIndexedPropertiesToPixelData()",
|
| "length exceeds max acceptable value")) {
|
| return;
|
| @@ -3457,7 +3457,7 @@ void v8::Object::SetIndexedPropertiesToExternalArrayData(
|
| ON_BAILOUT(isolate, "v8::SetIndexedPropertiesToExternalArrayData()", return);
|
| ENTER_V8(isolate);
|
| i::HandleScope scope(isolate);
|
| - if (!ApiCheck(length <= i::ExternalArray::kMaxLength,
|
| + if (!ApiCheck(length >= 0 && length <= i::ExternalArray::kMaxLength,
|
| "v8::Object::SetIndexedPropertiesToExternalArrayData()",
|
| "length exceeds max acceptable value")) {
|
| return;
|
|
|