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
97a0e755
Kaydet (Commit)
97a0e755
authored
Tem 20, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bail if offsets are past eof
Change-Id: I4a8e78231befff498894ec92a1f38af206e13129
üst
a3cc2d8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
10 deletions
+19
-10
hang-9.tiff
filter/qa/cppunit/data/tiff/fail/hang-9.tiff
+0
-0
itiff.cxx
filter/source/graphicfilter/itiff/itiff.cxx
+19
-10
No files found.
filter/qa/cppunit/data/tiff/fail/hang-9.tiff
0 → 100644
Dosyayı görüntüle @
97a0e755
188 Bytes
filter/source/graphicfilter/itiff/itiff.cxx
Dosyayı görüntüle @
97a0e755
...
@@ -57,6 +57,7 @@ private:
...
@@ -57,6 +57,7 @@ private:
BitmapWriteAccess
*
pMaskAcc
;
BitmapWriteAccess
*
pMaskAcc
;
sal_uLong
nOrigPos
;
// start position in pTIFF
sal_uLong
nOrigPos
;
// start position in pTIFF
sal_uLong
nEndOfFile
;
// end of file position in pTIFF
sal_uInt16
nDataType
;
sal_uInt16
nDataType
;
...
@@ -131,6 +132,7 @@ public:
...
@@ -131,6 +132,7 @@ public:
,
pAlphaMask
(
NULL
)
,
pAlphaMask
(
NULL
)
,
pMaskAcc
(
NULL
)
,
pMaskAcc
(
NULL
)
,
nOrigPos
(
0
)
,
nOrigPos
(
0
)
,
nEndOfFile
(
0
)
,
nDataType
(
0
)
,
nDataType
(
0
)
,
bByteSwap
(
false
)
,
bByteSwap
(
false
)
,
nNewSubFile
(
0
)
,
nNewSubFile
(
0
)
...
@@ -540,7 +542,7 @@ bool TIFFReader::ReadMap()
...
@@ -540,7 +542,7 @@ bool TIFFReader::ReadMap()
{
{
if
(
nCompression
==
1
||
nCompression
==
32771
)
if
(
nCompression
==
1
||
nCompression
==
32771
)
{
{
sal_uLong
n
p
,
n
Strip
,
nStripBytesPerRow
;
sal_uLong
nStrip
,
nStripBytesPerRow
;
if
(
nCompression
==
1
)
if
(
nCompression
==
1
)
nStripBytesPerRow
=
nBytesPerRow
;
nStripBytesPerRow
=
nBytesPerRow
;
...
@@ -548,7 +550,7 @@ bool TIFFReader::ReadMap()
...
@@ -548,7 +550,7 @@ bool TIFFReader::ReadMap()
nStripBytesPerRow
=
(
nBytesPerRow
+
1
)
&
0xfffffffe
;
nStripBytesPerRow
=
(
nBytesPerRow
+
1
)
&
0xfffffffe
;
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
{
{
for
(
np
=
0
;
np
<
nPlanes
;
np
++
)
for
(
sal_uLong
np
=
0
;
np
<
nPlanes
;
++
np
)
{
{
nStrip
=
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
;
nStrip
=
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
;
if
(
nStrip
>=
nNumStripOffsets
)
if
(
nStrip
>=
nNumStripOffsets
)
...
@@ -557,7 +559,7 @@ bool TIFFReader::ReadMap()
...
@@ -557,7 +559,7 @@ bool TIFFReader::ReadMap()
if
(
np
>=
SAL_N_ELEMENTS
(
pMap
))
if
(
np
>=
SAL_N_ELEMENTS
(
pMap
))
return
false
;
return
false
;
pTIFF
->
Read
(
pMap
[
np
],
nBytesPerRow
);
pTIFF
->
Read
(
pMap
[
np
],
nBytesPerRow
);
if
(
pTIFF
->
GetError
()
)
if
(
!
pTIFF
->
good
()
)
return
false
;
return
false
;
}
}
if
(
!
ConvertScanline
(
ny
)
)
if
(
!
ConvertScanline
(
ny
)
)
...
@@ -566,7 +568,7 @@ bool TIFFReader::ReadMap()
...
@@ -566,7 +568,7 @@ bool TIFFReader::ReadMap()
}
}
else
if
(
nCompression
==
2
||
nCompression
==
3
||
nCompression
==
4
)
else
if
(
nCompression
==
2
||
nCompression
==
3
||
nCompression
==
4
)
{
{
sal_uLong
n
p
,
n
Strip
,
nOptions
;
sal_uLong
nStrip
,
nOptions
;
if
(
nCompression
==
2
)
if
(
nCompression
==
2
)
{
{
nOptions
=
CCI_OPTION_BYTEALIGNROW
;
nOptions
=
CCI_OPTION_BYTEALIGNROW
;
...
@@ -595,6 +597,9 @@ bool TIFFReader::ReadMap()
...
@@ -595,6 +597,9 @@ bool TIFFReader::ReadMap()
nStrip
=
0
;
nStrip
=
0
;
if
(
nStrip
>=
nNumStripOffsets
)
if
(
nStrip
>=
nNumStripOffsets
)
return
false
;
return
false
;
sal_uLong
nOffset
=
pStripOffsets
[
nStrip
];
if
(
nOffset
>
nEndOfFile
)
return
false
;
pTIFF
->
Seek
(
pStripOffsets
[
nStrip
]);
pTIFF
->
Seek
(
pStripOffsets
[
nStrip
]);
CCIDecompressor
aCCIDecom
(
nOptions
,
nImageWidth
);
CCIDecompressor
aCCIDecom
(
nOptions
,
nImageWidth
);
...
@@ -603,14 +608,17 @@ bool TIFFReader::ReadMap()
...
@@ -603,14 +608,17 @@ bool TIFFReader::ReadMap()
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
{
{
for
(
np
=
0
;
np
<
nPlanes
;
np
++
)
for
(
sal_uLong
np
=
0
;
np
<
nPlanes
;
np
++
)
{
{
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
{
{
nStrip
=
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
;
nStrip
=
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
;
if
(
nStrip
>=
nNumStripOffsets
)
if
(
nStrip
>=
nNumStripOffsets
)
return
false
;
return
false
;
pTIFF
->
Seek
(
pStripOffsets
[
nStrip
]
);
nOffset
=
pStripOffsets
[
nStrip
];
if
(
nOffset
>
nEndOfFile
)
return
false
;
pTIFF
->
Seek
(
nOffset
);
aCCIDecom
.
StartDecompression
(
*
pTIFF
);
aCCIDecom
.
StartDecompression
(
*
pTIFF
);
}
}
if
(
np
>=
SAL_N_ELEMENTS
(
pMap
))
if
(
np
>=
SAL_N_ELEMENTS
(
pMap
))
...
@@ -627,7 +635,7 @@ bool TIFFReader::ReadMap()
...
@@ -627,7 +635,7 @@ bool TIFFReader::ReadMap()
else
if
(
nCompression
==
5
)
else
if
(
nCompression
==
5
)
{
{
LZWDecompressor
aLZWDecom
;
LZWDecompressor
aLZWDecom
;
sal_uLong
n
p
,
n
Strip
;
sal_uLong
nStrip
;
nStrip
=
0
;
nStrip
=
0
;
if
(
nStrip
>=
nNumStripOffsets
)
if
(
nStrip
>=
nNumStripOffsets
)
return
false
;
return
false
;
...
@@ -635,7 +643,7 @@ bool TIFFReader::ReadMap()
...
@@ -635,7 +643,7 @@ bool TIFFReader::ReadMap()
aLZWDecom
.
StartDecompression
(
*
pTIFF
);
aLZWDecom
.
StartDecompression
(
*
pTIFF
);
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
{
{
for
(
np
=
0
;
np
<
nPlanes
;
np
++
)
for
(
sal_uLong
np
=
0
;
np
<
nPlanes
;
++
np
)
{
{
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
{
{
...
@@ -656,7 +664,7 @@ bool TIFFReader::ReadMap()
...
@@ -656,7 +664,7 @@ bool TIFFReader::ReadMap()
}
}
else
if
(
nCompression
==
32773
)
else
if
(
nCompression
==
32773
)
{
{
sal_uLong
nStrip
,
nRecCount
,
np
,
i
;
sal_uLong
nStrip
,
nRecCount
,
i
;
sal_uInt8
*
pdst
;
sal_uInt8
*
pdst
;
nStrip
=
0
;
nStrip
=
0
;
if
(
nStrip
>=
nNumStripOffsets
)
if
(
nStrip
>=
nNumStripOffsets
)
...
@@ -664,7 +672,7 @@ bool TIFFReader::ReadMap()
...
@@ -664,7 +672,7 @@ bool TIFFReader::ReadMap()
pTIFF
->
Seek
(
pStripOffsets
[
nStrip
]);
pTIFF
->
Seek
(
pStripOffsets
[
nStrip
]);
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
for
(
sal_Int32
ny
=
0
;
ny
<
nImageLength
;
++
ny
)
{
{
for
(
np
=
0
;
np
<
nPlanes
;
np
++
)
for
(
sal_uLong
np
=
0
;
np
<
nPlanes
;
++
np
)
{
{
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
if
(
ny
/
GetRowsPerStrip
()
+
np
*
nStripsPerPlane
>
nStrip
)
{
{
...
@@ -1178,6 +1186,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
...
@@ -1178,6 +1186,7 @@ bool TIFFReader::ReadTIFF(SvStream & rTIFF, Graphic & rGraphic )
pTIFF
=
&
rTIFF
;
pTIFF
=
&
rTIFF
;
nMaxPos
=
nOrigPos
=
pTIFF
->
Tell
();
nMaxPos
=
nOrigPos
=
pTIFF
->
Tell
();
nEndOfFile
=
nOrigPos
+
pTIFF
->
remainingSize
();
// number format of pTIFF at the beginning
// number format of pTIFF at the beginning
SvStreamEndian
nOrigNumberFormat
=
pTIFF
->
GetEndian
();
SvStreamEndian
nOrigNumberFormat
=
pTIFF
->
GetEndian
();
...
...
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