Commit 74343675 authored by xhwang's avatar xhwang Committed by Commit bot

pp::Buffer_Dev: Clear PP_Resource upon Map() error in Init()

Now if Map() failed, we clear |data_| and |size_|, but |pp_resource_| is
not cleared. Therefore, if the caller calls buffer.is_null() it will
return false. Since the Init() failed, buffer.is_null() should return
true.

In this CL, if Map() failed, we call Clear() to explicitly clear
|pp_resource_|.

BUG=679801

Review-Url: https://codereview.chromium.org/2629543002
Cr-Commit-Position: refs/heads/master@{#443159}
parent 4aeafe93
......@@ -64,6 +64,8 @@ void Buffer_Dev::Init() {
if (data_)
return;
}
Clear();
data_ = NULL;
size_ = 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment