Closed Bug 715471 Opened 8 years ago Closed 8 years ago
use fallible allocation for potentially large buffers in ns
Text Frame Thebes .cpp
From bug 703100 comment 57: We should review the existing buffer allocations in nsTextFrameThebes.cpp, and switch to fallible arrays in some cases where we're allocating space for a potentially huge string of text, and the code include checks for failure - it was clearly written assuming fallible arrays, but we've since changed the default behavior of arrays. The buffer passed to BuildTextRunForFrames, for example, should be allocated fallibly, as should the temporary buffer used when we need to "expand" 8- to 16-bit text. Basically, wherever we're doing "nsAutoTArray<T,BIG_TEXT_NODE_SIZE>", we probably want FallibleAutoTArray.
Assignee: nobody → jfkthame
Attachment #588005 - Flags: review?(roc)
Attachment #588005 - Flags: review?(roc) → review+
Backed out of inbound for multiple test failures: https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=148044813372 https://hg.mozilla.org/integration/mozilla-inbound/rev/7ee957b3e883
Status: NEW → ASSIGNED
Re-landed without the change to how BuildTextRunForFrames is called (it needs to be able to return null for the textrun without this being treated as failure): https://hg.mozilla.org/integration/mozilla-inbound/rev/4117cd7064ee
Target Milestone: --- → mozilla12
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.