Issue #1540 - Stop MP3 demuxer from choking on very small files.

This commit is contained in:
athenian200 2020-05-10 06:45:59 -05:00 committed by Roy Tam
commit 7ae0c88c46

View file

@ -396,7 +396,10 @@ MP3TrackDemuxer::Duration(int64_t aNumFrames) const {
MediaByteRange
MP3TrackDemuxer::FindFirstFrame() {
static const int MIN_SUCCESSIVE_FRAMES = 4;
// This check is meant to avoid invalid frames from broken streams, but
// small MP3 files and streams with odd header data can break this. Lowering
// the value to 3 seems to help significantly.
static const int MIN_SUCCESSIVE_FRAMES = 3;
MediaByteRange candidateFrame = FindNextFrame();
int numSuccFrames = candidateFrame.Length() > 0;