Closed Bug 816143 Opened 13 years ago Closed 13 years ago

Teach AudioStream::EnsureTimeStretcherInitialized() about infallible malloc

Categories

(Core :: Audio/Video, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: dholbert, Assigned: padenot)

References

Details

Attachments

(1 file)

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.
Indeed we use infaillible malloc.
Attachment #686502 - Flags: review?(kinetik)
Assignee: nobody → paul
Attachment #686502 - Flags: review?(kinetik) → review+
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.

Attachment

General

Created:
Updated:
Size: