Closed Bug 1764861 Opened 2 years ago Closed 2 years ago

Fix memory leak in DynamicResampler::UpdateResampler

Categories

(Core :: Audio/Video: MediaStreamGraph, defect, P1)

defect

Tracking

()

RESOLVED FIXED
101 Branch
Tracking Status
firefox101 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

Details

Attachments

(1 file)

We should call speex_resampler_destroy(mResampler) if mResampler is non-null before mResampler = speex_resampler_init(...) [1]. Otherwise the memory space occupied by the old mResampler is never released.

[1] https://searchfox.org/mozilla-central/rev/d34f9713ae128a3138c2b70d8041a535f1049d19/dom/media/DynamicResampler.cpp#107

This can be verified by adding an MOZ_ASSERT(!mResampler) before mResampler = speex_resampler_init(...) when running TestDynamicResampler.UpdateChannels_Float

Blocks: 1238038
Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b691f16ed296
Release SpeexResamplerState if needed r=padenot
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 101 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: