diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-07-12 16:30:42 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-07-12 18:45:14 +0200 |
commit | 52e1a6a3e4d613eeb9313922098b0ba11807fb12 (patch) | |
tree | cc3ef1ca5589566a5b327a62c8a56dbbe0f28c8b /sc/inc | |
parent | 56dff7b244fb0ef28951193a410dd5c4a3126590 (diff) |
use a read-only stream when reading graphic data
EmbeddedObjectRef::GetGraphicStream() creates a writable
SvMemoryStream, read the graphics data into it and then returns
the stream, which will be afterwards used to decode the graphics.
But if the data is broken, incorrect seeking may cause a seek
way past the buffer, and since the stream is writable, it would
be done and cause problems such as running out of memory.
The VersionCompatRead class is one such place that reads size
from the stream and then seeks based on the read data.
Add SvMemoryStream::MakeReadOnly() that will change the stream
to be read-only after the initial read of the data into it.
Change-Id: I1d44aabaf73071a691adafa489e65e4f5e3f021d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137002
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc/inc')
0 files changed, 0 insertions, 0 deletions