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
9ff94ae0
Kaydet (Commit)
9ff94ae0
authored
Nis 17, 2012
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
png parsing regression test
üst
b1bee56a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
11 deletions
+42
-11
bitmapdevice.cxx
basebmp/source/bitmapdevice.cxx
+10
-2
.gitignore
svtools/qa/cppunit/data/png/fail/.gitignore
+0
-0
CVE-2004-0597-1.png
svtools/qa/cppunit/data/png/fail/CVE-2004-0597-1.png
+4
-0
CVE-2005-0633-1.png
svtools/qa/cppunit/data/png/fail/CVE-2005-0633-1.png
+0
-0
CVE-2006-7210-1.png
svtools/qa/cppunit/data/png/fail/CVE-2006-7210-1.png
+0
-0
CVE-2007-2365-1.png
svtools/qa/cppunit/data/png/fail/CVE-2007-2365-1.png
+0
-0
CVE-2009-1511-1.png
svtools/qa/cppunit/data/png/fail/CVE-2009-1511-1.png
+2
-0
.gitignore
svtools/qa/cppunit/data/png/indeterminate/.gitignore
+0
-0
.gitignore
svtools/qa/cppunit/data/png/pass/.gitignore
+0
-0
black.png
svtools/qa/cppunit/data/png/pass/black.png
+0
-0
filters-test.cxx
svtools/qa/cppunit/filters-test.cxx
+4
-0
pngread.cxx
vcl/source/gdi/pngread.cxx
+22
-9
No files found.
basebmp/source/bitmapdevice.cxx
Dosyayı görüntüle @
9ff94ae0
...
@@ -1881,8 +1881,16 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector&
...
@@ -1881,8 +1881,16 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector&
// factor in bottom-up scanline order case
// factor in bottom-up scanline order case
nScanlineStride
*=
bTopDown
?
1
:
-
1
;
nScanlineStride
*=
bTopDown
?
1
:
-
1
;
const
std
::
size_t
nMemSize
(
const
sal_uInt32
nWidth
(
nScanlineStride
<
0
?
-
nScanlineStride
:
nScanlineStride
);
(
nScanlineStride
<
0
?
-
nScanlineStride
:
nScanlineStride
)
*
rSize
.
getY
()
);
const
sal_uInt32
nHeight
(
rSize
.
getY
());
if
(
nHeight
&&
nWidth
&&
nWidth
>
SAL_MAX_INT32
/
nHeight
)
{
SAL_WARN
(
"basebmp"
,
"suspicious massive alloc "
<<
nWidth
<<
" * "
<<
nHeight
);
return
BitmapDeviceSharedPtr
();
}
const
std
::
size_t
nMemSize
(
nWidth
*
nHeight
);
if
(
!
pMem
)
if
(
!
pMem
)
{
{
...
...
svtools/qa/cppunit/data/png/fail/.gitignore
0 → 100644
Dosyayı görüntüle @
9ff94ae0
svtools/qa/cppunit/data/png/fail/CVE-2004-0597-1.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
#Mb}o72~X.^TwB!f1s tga2bAHb"8|eGfS$N0nI֪
0"JGzܢ(s?d)"GEF9~}r TΝp?*ck$E"X8=2T_3v#$Hh4JKi݊J&7r=u69KjWh{$ dV[Жy\%%ǾHme+ }gXI2>*ī& )̸6pUTjODh1-<WURK591M?
~*Nru;khX{֍Ԥ' ӏwF[KRfyO%0ihx׃wz4dT.@Xm4ipZ^yЯ`_Y? tuw4\kdJ~mg`<2ln* kh*nw7!YIßP+hK*Ԟ`?
\ No newline at end of file
svtools/qa/cppunit/data/png/fail/CVE-2005-0633-1.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
346 Bytes
svtools/qa/cppunit/data/png/fail/CVE-2006-7210-1.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
2.44 KB
svtools/qa/cppunit/data/png/fail/CVE-2007-2365-1.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
18 KB
svtools/qa/cppunit/data/png/fail/CVE-2009-1511-1.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
#Mb}o72͐~\._舄{'p|&F/
\ No newline at end of file
svtools/qa/cppunit/data/png/indeterminate/.gitignore
0 → 100644
Dosyayı görüntüle @
9ff94ae0
svtools/qa/cppunit/data/png/pass/.gitignore
0 → 100644
Dosyayı görüntüle @
9ff94ae0
svtools/qa/cppunit/data/png/pass/black.png
0 → 100644
Dosyayı görüntüle @
9ff94ae0
175 Bytes
svtools/qa/cppunit/filters-test.cxx
Dosyayı görüntüle @
9ff94ae0
...
@@ -80,6 +80,10 @@ void SvtoolsFiltersTest::testCVEs()
...
@@ -80,6 +80,10 @@ void SvtoolsFiltersTest::testCVEs()
testDir
(
rtl
::
OUString
(),
testDir
(
rtl
::
OUString
(),
getURLFromSrc
(
"/svtools/qa/cppunit/data/sgv/"
),
getURLFromSrc
(
"/svtools/qa/cppunit/data/sgv/"
),
rtl
::
OUString
());
rtl
::
OUString
());
testDir
(
rtl
::
OUString
(),
getURLFromSrc
(
"/svtools/qa/cppunit/data/png/"
),
rtl
::
OUString
());
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
SvtoolsFiltersTest
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
SvtoolsFiltersTest
);
...
...
vcl/source/gdi/pngread.cxx
Dosyayı görüntüle @
9ff94ae0
...
@@ -194,6 +194,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
...
@@ -194,6 +194,7 @@ PNGReaderImpl::PNGReaderImpl( SvStream& rPNGStream )
mpScanCurrent
(
NULL
),
mpScanCurrent
(
NULL
),
mpColorTable
(
(
sal_uInt8
*
)
mpDefaultColorTable
),
mpColorTable
(
(
sal_uInt8
*
)
mpDefaultColorTable
),
mnPass
(
0
),
mnPass
(
0
),
mbPalette
(
sal_False
),
mbzCodecInUse
(
sal_False
),
mbzCodecInUse
(
sal_False
),
mbStatus
(
sal_True
),
mbStatus
(
sal_True
),
mbIDAT
(
sal_False
),
mbIDAT
(
sal_False
),
...
@@ -297,7 +298,7 @@ bool PNGReaderImpl::ReadNextChunk()
...
@@ -297,7 +298,7 @@ bool PNGReaderImpl::ReadNextChunk()
nCRC32
=
rtl_crc32
(
nCRC32
,
&
rChunkData
.
aData
[
0
],
mnChunkLen
);
nCRC32
=
rtl_crc32
(
nCRC32
,
&
rChunkData
.
aData
[
0
],
mnChunkLen
);
maDataIter
=
rChunkData
.
aData
.
begin
();
maDataIter
=
rChunkData
.
aData
.
begin
();
}
}
sal_uInt32
nCheck
;
sal_uInt32
nCheck
(
0
)
;
mrPNGStream
>>
nCheck
;
mrPNGStream
>>
nCheck
;
if
(
nCRC32
!=
nCheck
)
if
(
nCRC32
!=
nCheck
)
return
false
;
return
false
;
...
@@ -339,14 +340,23 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
...
@@ -339,14 +340,23 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint )
// reset to the first chunk
// reset to the first chunk
maChunkIter
=
maChunkSeq
.
begin
();
maChunkIter
=
maChunkSeq
.
begin
();
// parse the chunks
// first chunk must be IDHR
if
(
mbStatus
&&
ReadNextChunk
()
)
{
if
(
mnChunkType
==
PNGCHUNK_IHDR
)
mbStatus
=
ImplReadHeader
(
rPreviewSizeHint
);
else
mbStatus
=
false
;
}
// parse the remaining chunks
while
(
mbStatus
&&
!
mbIDAT
&&
ReadNextChunk
()
)
while
(
mbStatus
&&
!
mbIDAT
&&
ReadNextChunk
()
)
{
{
switch
(
mnChunkType
)
switch
(
mnChunkType
)
{
{
case
PNGCHUNK_IHDR
:
case
PNGCHUNK_IHDR
:
{
{
mbStatus
=
ImplReadHeader
(
rPreviewSizeHint
);
mbStatus
=
false
;
//IHDR should only appear as the first chunk
}
}
break
;
break
;
...
@@ -756,14 +766,17 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
...
@@ -756,14 +766,17 @@ sal_Bool PNGReaderImpl::ImplReadTransparent()
{
{
if
(
mnChunkLen
<=
256
)
if
(
mnChunkLen
<=
256
)
{
{
mbTransparent
=
true
;
mpTransTab
=
new
sal_uInt8
[
256
];
mpTransTab
=
new
sal_uInt8
[
256
];
rtl_fillMemory
(
mpTransTab
,
256
,
0xff
);
rtl_fillMemory
(
mpTransTab
,
256
,
0xff
);
rtl_copyMemory
(
mpTransTab
,
&
(
*
maDataIter
),
mnChunkLen
);
if
(
mnChunkLen
>
0
)
maDataIter
+=
mnChunkLen
;
{
mbTransparent
=
true
;
rtl_copyMemory
(
mpTransTab
,
&
(
*
maDataIter
),
mnChunkLen
);
// need alpha transparency if not on/off masking
maDataIter
+=
mnChunkLen
;
for
(
int
i
=
0
;
i
<
mnChunkLen
;
++
i
)
// need alpha transparency if not on/off masking
bNeedAlpha
|=
(
mpTransTab
[
i
]
!=
0x00
)
&&
(
mpTransTab
[
i
]
!=
0xFF
);
for
(
int
i
=
0
;
i
<
mnChunkLen
;
++
i
)
bNeedAlpha
|=
(
mpTransTab
[
i
]
!=
0x00
)
&&
(
mpTransTab
[
i
]
!=
0xFF
);
}
}
}
}
}
break
;
break
;
...
...
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