Bug 1303902: [FLAC] Actually check that we found the first frame. r?kamidphish draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 20 Sep 2016 11:43:23 +1000
changeset 415432 8b65535418616ed8e7401485265ccad731b2bea1
parent 415259 24c328e12c9886b871726efd823d4497e89eeaac
child 415474 61001a63cc5663fbe3eee453843e24bf696ac5f8
push id29869
push userbmo:jyavenard@mozilla.com
push dateTue, 20 Sep 2016 09:28:47 +0000
reviewerskamidphish
bugs1303902
milestone52.0a1
Bug 1303902: [FLAC] Actually check that we found the first frame. r?kamidphish MozReview-Commit-ID: 3VRf49DqB00
dom/media/flac/FlacDemuxer.cpp
--- a/dom/media/flac/FlacDemuxer.cpp
+++ b/dom/media/flac/FlacDemuxer.cpp
@@ -671,17 +671,17 @@ FlacTrackDemuxer::Init()
   // Can seek there immediately to avoid reparsing it all.
   mSource.Seek(SEEK_SET, offset);
 
   // Find the first frame to fully initialise our parser.
   if (mParser->FindNextFrame(mSource)) {
     // Ensure that the next frame returned will be the first.
     mSource.Seek(SEEK_SET, mParser->FirstFrame().Offset());
     mParser->EndFrameSession();
-  } else if (!mParser->Info().IsValid()) {
+  } else if (!mParser->Info().IsValid() || !mParser->FirstFrame().IsValid()) {
     // We must find at least a frame to determine the metadata.
     // We can't play this stream.
     return false;
   }
 
   if (!mParser->Info().IsValid() || !mParser->Info().mDuration) {
     // Check if we can look at the last frame for the end time to determine the
     // duration when we don't have any.