AudioSegment::FlushAfter is crashing for new end equals to zero
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox72 | --- | fixed |
People
(Reporter: achronop, Assigned: achronop)
Details
Attachments
(2 files)
The crash happens in [1] and reproduces only when the segment contains audio data. Reading the assert in AudioSegment::SliceTo()
, it does not expect zero duration slice. The call to the SliceTo()
method happens in [2].
In general, when FlushAfter(0)
is called (with new-end equals zero) the segment can handle it as a special case a clears itself.
[1] https://searchfox.org/mozilla-central/rev/3300072e993ae05d50d5c63d815260367eaf9179/dom/media/AudioSegment.h#152
[2] https://searchfox.org/mozilla-central/rev/3300072e993ae05d50d5c63d815260367eaf9179/dom/media/MediaSegment.h#262
Assignee | ||
Comment 1•5 years ago
|
||
The AudioSegment::FlushAfter with input argument equals to zero is crashing on an assert that indicates misuse of the AudioChunk::SliceTo method. In general MediaSegmentBase::FlushAfter is better to clear itself when is called with argument equals to zero. This avoids the misuse and it is slightly more efficient.
Assignee | ||
Comment 2•5 years ago
|
||
Fix MediaSegmentBase::RemoveTrailing
to be able to accept the first argument, keep frames, equal to zero. The patch avoids calling the AudioChunk::SliceTo()
method with zero slice duration which hits an assert. The crash was being triggered when in the AudioSegment was including one or more chunks, with the first chunk containing silence (null). Then the AudioSegment::FlushAfter
had to be called with a duration smaller or equal to the duration of the first chunk. A unit test has been created, verifying the duration of the final segment.
Assignee | ||
Comment 3•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0c6ec82377ca9b3fabfdbdd98541783bf524d7de
Assignee | ||
Comment 4•5 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=afdebda3b56d997fc18b163b52b553d6abe3f2a0
Pushed by achronopoulos@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb5434e79ec6 Clear the AudioSegment when FlushAfter is called with new end equals to zero. r=padenot https://hg.mozilla.org/integration/autoland/rev/f331f382d86b Fix RemoveTrailing to handle correctly keep frames equals to zero. r=padenot
Comment 6•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cb5434e79ec6
https://hg.mozilla.org/mozilla-central/rev/f331f382d86b
Description
•