Bug 1285867 (Part 3a) - Don't attempt to keep decoding if we're already done. r=edwin

This commit is contained in:
Seth Fowler 2016-07-11 23:02:20 -07:00
parent 0872ad00cb
commit f5b3f999dd

View File

@ -119,6 +119,11 @@ Decoder::Decode(NotNull<IResumable*> aOnResume)
MOZ_ASSERT(mInitialized, "Should be initialized here"); MOZ_ASSERT(mInitialized, "Should be initialized here");
MOZ_ASSERT(mIterator, "Should have a SourceBufferIterator"); MOZ_ASSERT(mIterator, "Should have a SourceBufferIterator");
// If we're already done, don't attempt to keep decoding.
if (GetDecodeDone()) {
return HasError() ? NS_ERROR_FAILURE : NS_OK;
}
// We keep decoding chunks until the decode completes or there are no more // We keep decoding chunks until the decode completes or there are no more
// chunks available. // chunks available.
while (!GetDecodeDone() && !HasError()) { while (!GetDecodeDone() && !HasError()) {