зеркало из https://github.com/mozilla/gecko-dev.git
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
This commit is contained in:
Родитель
4c1f863637
Коммит
7e7b0ded7c
|
@ -38,7 +38,8 @@ STDMETHODIMP MFPMPHostWrapper::ActivateClassById(LPCWSTR aId, IStream* aStream,
|
||||||
STATSTG statstg;
|
STATSTG statstg;
|
||||||
RETURN_IF_FAILED(
|
RETURN_IF_FAILED(
|
||||||
aStream->Stat(&statstg, STATFLAG_NOOPEN | STATFLAG_NONAME));
|
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;
|
unsigned long readSize = 0;
|
||||||
RETURN_IF_FAILED(
|
RETURN_IF_FAILED(
|
||||||
aStream->Read(&streamBlob[0], streamBlob.Length(), &readSize));
|
aStream->Read(&streamBlob[0], streamBlob.Length(), &readSize));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче