Bug 1272371 - Update multiplexed input stream seek behaviour. r=froydnj
authorBryce Van Dyk <bvandyk@mozilla.com>
Thu, 25 May 2017 13:38:01 +1200
changeset 361936 f30bf8724ee98a6e4ccb88edbd0d3af746838233
parent 361935 c612f1bb40a4dc755d406322b02211e175f46abb
child 361937 fcf76659f264e52a535658aa826271e7b0559c3f
push id31952
push usercbook@mozilla.com
push dateFri, 02 Jun 2017 12:17:25 +0000
treeherdermozilla-central@194c009d6295 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1272371
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 1272371 - Update multiplexed input stream seek behaviour. r=froydnj This patch is originally from :baku and updates the seek behaviour of nsMulitplexInputStream. This fixes an issue with absolute seeking where if a seek is performed and the correct offset reached, the members of the multiplex stream were not updated to reflect this. MozReview-Commit-ID: 7lEvuXxzYkI
xpcom/io/nsMultiplexInputStream.cpp
--- a/xpcom/io/nsMultiplexInputStream.cpp
+++ b/xpcom/io/nsMultiplexInputStream.cpp
@@ -496,17 +496,20 @@ nsMultiplexInputStream::Seek(int32_t aWh
           mCurrentStream = i;
           mStartedReadingCurrent = true;
 
           remaining -= newPos;
           NS_ASSERTION(remaining >= 0, "Remaining invalid");
         }
       } else {
         NS_ASSERTION(remaining == streamPos, "Huh?");
+        MOZ_ASSERT(remaining != 0, "Zero remaining should be handled earlier");
         remaining = 0;
+        mCurrentStream = i;
+        mStartedReadingCurrent = true;
       }
     }
 
     return NS_OK;
   }
 
   if (aWhence == NS_SEEK_CUR && aOffset > 0) {
     int64_t remaining = aOffset;