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•6 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•6 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•6 years ago
|
||
Assignee | ||
Comment 4•6 years ago
|
||
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cb5434e79ec6
https://hg.mozilla.org/mozilla-central/rev/f331f382d86b
Description
•