Commit 91c67276 authored by Paul Adenot's avatar Paul Adenot
Browse files

Bug 1843960 - Skip over ID3v1 tag in the middle of mp3 bytestreams. r=alwu, a=dsmith

parent 5314ff0d
Loading
Loading
Loading
Loading
+4 −3
Changes for dom/media/mp3/MP3FrameParser.cpp: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -87,12 +87,13 @@ Result<bool, nsresult> FrameParser::Parse(BufferReader* aReader,
  *aBytesToSkip = 0;

  if (ID3Parser::IsBufferStartingWithID3v1Tag(aReader)) {
    // This is at the end of the file, and is always 128 bytes, that can simply
    // be skipped.
    // This is usually at the end of the file, and is always 128 bytes, that
    // can simply be skipped.
    aReader->Read(128);
    *aBytesToSkip = 128;
    mID3v1MetadataFound = true;
    return true;
    MP3LOGV("ID3v1 tag detected, skipping 128 bytes past the current buffer");
    return false;
  }

  if (ID3Parser::IsBufferStartingWithID3Tag(aReader) && !mFirstFrame.Length()) {