Bug 1139005 - Need to check the return value of AutoJSAPI.init in canvas EncodeCallback (r=ayang)
This commit is contained in:
@@ -561,8 +561,9 @@ HTMLCanvasElement::ToBlob(JSContext* aCx,
|
||||
nsresult rv = blob->GetSize(&size);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
AutoJSAPI jsapi;
|
||||
jsapi.Init(mGlobal);
|
||||
JS_updateMallocCounter(jsapi.cx(), size);
|
||||
if (jsapi.Init(mGlobal)) {
|
||||
JS_updateMallocCounter(jsapi.cx(), size);
|
||||
}
|
||||
}
|
||||
|
||||
nsRefPtr<File> newBlob = new File(mGlobal, blob->Impl());
|
||||
|
||||
Reference in New Issue
Block a user