Bug 699780 - Redundant call to Seek() in nsStorageStream::GetOutputStream(); r=bsmedberg

This commit is contained in:
bjarne@runitsoft.com 2011-11-08 07:41:54 +00:00
parent 2f9171b753
commit 49170ce086

View File

@ -123,11 +123,11 @@ nsStorageStream::GetOutputStream(PRInt32 aStartingOffset,
// all the other segments in the buffer. (It may have been realloc'ed
// smaller in the Close() method.)
if (mLastSegmentNum >= 0)
mSegmentedBuffer->ReallocLastSegment(mSegmentSize);
// Need to re-Seek, since realloc might have changed segment base pointer
rv = Seek(aStartingOffset);
if (NS_FAILED(rv)) return rv;
if (mSegmentedBuffer->ReallocLastSegment(mSegmentSize)) {
// Need to re-Seek, since realloc changed segment base pointer
rv = Seek(aStartingOffset);
if (NS_FAILED(rv)) return rv;
}
NS_ADDREF(this);
*aOutputStream = static_cast<nsIOutputStream*>(this);