Bug 1368856: initialize variable. r=rillian
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 31 May 2017 09:53:03 +0200
changeset 409717 cb69c9d70a96df96f15f7f04305f6858e3b2df16
parent 409716 cb9066e8f9f379ccb3bdb341af87db369987b996
child 409718 c516c8e50993b41050917a57edfd331d06a03de4
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1368856
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1368856: initialize variable. r=rillian There's no way to verify locally the while loop will execute and set the return value, so we get an uninitialized variable warning. Initialize it at declaration time to failure, relying on the later code to override with success. Actually, it doesn't matter what we initialize it to, since the while loop will never terminal if GetNextPacket somehow returns success without pushing a new packet onto the sample array. But this silences the warning. MozReview-Commit-ID: 20rh1OGpR1E
dom/media/webm/WebMDemuxer.cpp
--- a/dom/media/webm/WebMDemuxer.cpp
+++ b/dom/media/webm/WebMDemuxer.cpp
@@ -1106,17 +1106,17 @@ WebMTrackDemuxer::Seek(const TimeUnit& a
   SetNextKeyFrameTime();
 
   return SeekPromise::CreateAndResolve(seekTime, __func__);
 }
 
 nsresult
 WebMTrackDemuxer::NextSample(RefPtr<MediaRawData>& aData)
 {
-  nsresult rv;
+  nsresult rv = NS_ERROR_DOM_MEDIA_END_OF_STREAM;;
   while (mSamples.GetSize() < 1 &&
          NS_SUCCEEDED((rv = mParent->GetNextPacket(mType, &mSamples)))) {
   }
   if (mSamples.GetSize()) {
     aData = mSamples.PopFront();
     return NS_OK;
   }
   return rv;