Kaydet (Commit) a42d9c5b authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: oom on seeks past end of SvMemoryStream

cause it grows to fit if its a resizable stream

Change-Id: I28b42becdfc8eb591d19d2512cdc1f1ec32c3bbe
üst b2a76e66
......@@ -104,7 +104,7 @@ using namespace OpenStormBento;
bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed)
std::unique_ptr<SvStream> aDecompressed(new SvMemoryStream(4096, 4096));
std::unique_ptr<SvMemoryStream> aDecompressed(new SvMemoryStream(4096, 4096));
unsigned char buffer[512];
pCompressed->ReadBytes(buffer, 16);
aDecompressed->WriteBytes(buffer, 16);
......@@ -136,6 +136,9 @@ bool Decompress(SvStream *pCompressed, SvStream * & pOutDecompressed)
while (sal_uInt32 iRead = pCompressed->ReadBytes(buffer, 512))
aDecompressed->WriteBytes(buffer, iRead);
// disable stream growing past its current size
//transfer ownership of aDecompressed's ptr
pOutDecompressed = aDecompressed.release();
return true;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment