Commit 8640e7c7 authored by alwu's avatar alwu
Browse files

Bug 1821803 - part3 : set size on the streamBlob. r=jolin

The ctor for the nsTArray only sets the capacity, not size, so we need
to set it explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D172488
parent 7fe07199
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -38,7 +38,8 @@ STDMETHODIMP MFPMPHostWrapper::ActivateClassById(LPCWSTR aId, IStream* aStream,
    STATSTG statstg;
    RETURN_IF_FAILED(
        aStream->Stat(&statstg, STATFLAG_NOOPEN | STATFLAG_NONAME));
    nsTArray<uint8_t> streamBlob(statstg.cbSize.LowPart);
    nsTArray<uint8_t> streamBlob;
    streamBlob.SetLength(statstg.cbSize.LowPart);
    unsigned long readSize = 0;
    RETURN_IF_FAILED(
        aStream->Read(&streamBlob[0], streamBlob.Length(), &readSize));