Bug 1272371 - Update multiplexed input stream seek behaviour. r?froydnj draft
authorBryce Van Dyk <bvandyk@mozilla.com>
Thu, 25 May 2017 13:38:01 +1200
changeset 587972 53672d84e03a68db9b4a8f73a2c6b1144119247c
parent 587971 4db0d471f5db66c5d6d511ffe5ce18016987c714
child 631424 f3f27833bbf248b184b08d1899ecad22a82b39e1
push id61870
push userbvandyk@mozilla.com
push dateThu, 01 Jun 2017 23:59:21 +0000
reviewersfroydnj
bugs1272371
milestone55.0a1
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;