Closed
Bug 816143
Opened 13 years ago
Closed 13 years ago
Teach AudioStream::EnsureTimeStretcherInitialized() about infallible malloc
Categories
(Core :: Audio/Video, defect)
Core
Audio/Video
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: dholbert, Assigned: padenot)
References
Details
Attachments
(1 file)
|
5.15 KB,
patch
|
kinetik
:
review+
|
Details | Diff | Splinter Review |
Just noticed this chunk go by in a patch for bug 814708:
>+++ b/content/media/AudioStream.cpp
> bool AudioStream::EnsureTimeStretcherInitialized()
[...]
>- soundtouch::SoundTouch* state = new soundtouch::SoundTouch();
>- if (!state) {
>+ mTimeStretcher = new soundtouch::SoundTouch();
>+ if (!mTimeStretcher) {
> return false;
> }
I'm pretty sure we don't need to bother with the null-check-after-new for mTimeStretcher (or "state" in the pre-patched code), since we have infallible-malloc. (Unless this code has somehow requested a different malloc impl)
Incidentally, that also means that EnsureTimeStretcherInitialized can become infallible (return void instead of bool) itself. This might mean some callers can be cleaned up as well -- I didn't follow the chain up further than that.
| Assignee | ||
Comment 1•13 years ago
|
||
Indeed we use infaillible malloc.
Attachment #686502 -
Flags: review?(kinetik)
| Assignee | ||
Updated•13 years ago
|
Assignee: nobody → paul
Updated•13 years ago
|
Attachment #686502 -
Flags: review?(kinetik) → review+
| Assignee | ||
Comment 2•13 years ago
|
||
Comment 3•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in
before you can comment on or make changes to this bug.
Description
•