Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d1f31681
Kaydet (Commit)
d1f31681
authored
Ock 27, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ofz: check if the stream is able to meet the eps len claim before reading
Change-Id: I440c7f38d6588c570a411f2a97c0164e5d7d646f
üst
b602313a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
ieps.cxx
filter/source/graphicfilter/ieps/ieps.cxx
+11
-13
No files found.
filter/source/graphicfilter/ieps/ieps.cxx
Dosyayı görüntüle @
d1f31681
...
@@ -399,6 +399,15 @@ static bool RenderAsBMP(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
...
@@ -399,6 +399,15 @@ static bool RenderAsBMP(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
return
RenderAsBMPThroughConvert
(
pBuf
,
nBytesRead
,
rGraphic
);
return
RenderAsBMPThroughConvert
(
pBuf
,
nBytesRead
,
rGraphic
);
}
}
namespace
{
bool
checkSeek
(
SvStream
&
rSt
,
sal_uInt32
nOffset
)
{
const
sal_uInt64
nMaxSeek
(
rSt
.
Tell
()
+
rSt
.
remainingSize
());
return
(
nOffset
<=
nMaxSeek
&&
rSt
.
Seek
(
nOffset
)
==
nOffset
);
}
}
// this method adds a replacement action containing the original wmf or tiff replacement,
// this method adds a replacement action containing the original wmf or tiff replacement,
// so the original eps can be written when storing to ODF.
// so the original eps can be written when storing to ODF.
void
CreateMtfReplacementAction
(
GDIMetaFile
&
rMtf
,
SvStream
&
rStrm
,
sal_uInt32
nOrigPos
,
sal_uInt32
nPSSize
,
void
CreateMtfReplacementAction
(
GDIMetaFile
&
rMtf
,
SvStream
&
rStrm
,
sal_uInt32
nOrigPos
,
sal_uInt32
nPSSize
,
...
@@ -416,17 +425,15 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32
...
@@ -416,17 +425,15 @@ void CreateMtfReplacementAction( GDIMetaFile& rMtf, SvStream& rStrm, sal_uInt32
aReplacement
.
WriteUInt32
(
nMagic
).
WriteUInt32
(
nPPos
).
WriteUInt32
(
nPSSize
)
aReplacement
.
WriteUInt32
(
nMagic
).
WriteUInt32
(
nPPos
).
WriteUInt32
(
nPSSize
)
.
WriteUInt32
(
nWPos
).
WriteUInt32
(
nSizeWMF
)
.
WriteUInt32
(
nWPos
).
WriteUInt32
(
nSizeWMF
)
.
WriteUInt32
(
nTPos
).
WriteUInt32
(
nSizeTIFF
);
.
WriteUInt32
(
nTPos
).
WriteUInt32
(
nSizeTIFF
);
if
(
nSizeWMF
)
if
(
nSizeWMF
&&
checkSeek
(
rStrm
,
nOrigPos
+
nPosWMF
)
&&
rStrm
.
remainingSize
()
>=
nSizeWMF
)
{
{
std
::
unique_ptr
<
sal_uInt8
[]
>
pBuf
(
new
sal_uInt8
[
nSizeWMF
]);
std
::
unique_ptr
<
sal_uInt8
[]
>
pBuf
(
new
sal_uInt8
[
nSizeWMF
]);
rStrm
.
Seek
(
nOrigPos
+
nPosWMF
);
rStrm
.
ReadBytes
(
pBuf
.
get
(),
nSizeWMF
);
rStrm
.
ReadBytes
(
pBuf
.
get
(),
nSizeWMF
);
aReplacement
.
WriteBytes
(
pBuf
.
get
(),
nSizeWMF
);
aReplacement
.
WriteBytes
(
pBuf
.
get
(),
nSizeWMF
);
}
}
if
(
nSizeTIFF
)
if
(
nSizeTIFF
&&
checkSeek
(
rStrm
,
nOrigPos
+
nPosTIFF
)
&&
rStrm
.
remainingSize
()
>=
nSizeTIFF
)
{
{
std
::
unique_ptr
<
sal_uInt8
[]
>
pBuf
(
new
sal_uInt8
[
nSizeTIFF
]);
std
::
unique_ptr
<
sal_uInt8
[]
>
pBuf
(
new
sal_uInt8
[
nSizeTIFF
]);
rStrm
.
Seek
(
nOrigPos
+
nPosTIFF
);
rStrm
.
ReadBytes
(
pBuf
.
get
(),
nSizeTIFF
);
rStrm
.
ReadBytes
(
pBuf
.
get
(),
nSizeTIFF
);
aReplacement
.
WriteBytes
(
pBuf
.
get
(),
nSizeTIFF
);
aReplacement
.
WriteBytes
(
pBuf
.
get
(),
nSizeTIFF
);
}
}
...
@@ -519,15 +526,6 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
...
@@ -519,15 +526,6 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead,
rGraphic
=
aMtf
;
rGraphic
=
aMtf
;
}
}
namespace
{
bool
checkSeek
(
SvStream
&
rSt
,
sal_uInt32
nOffset
)
{
const
sal_uInt64
nMaxSeek
(
rSt
.
Tell
()
+
rSt
.
remainingSize
());
return
(
nOffset
<=
nMaxSeek
&&
rSt
.
Seek
(
nOffset
)
==
nOffset
);
}
}
//================== GraphicImport - the exported function ================
//================== GraphicImport - the exported function ================
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment