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
642cf9af
Kaydet (Commit)
642cf9af
authored
Kas 14, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1209863 Untrusted loop bound
Change-Id: I3de3601f489db2a4dafb4d80f5ef35d5db38ba76
üst
71c00f4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
impfont.cxx
vcl/source/gdi/impfont.cxx
+11
-2
No files found.
vcl/source/gdi/impfont.cxx
Dosyayı görüntüle @
642cf9af
...
@@ -110,6 +110,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
...
@@ -110,6 +110,8 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
if
(
(
nSubTables
<=
0
)
||
(
nLength
<
(
24
+
8
*
nSubTables
))
)
if
(
(
nSubTables
<=
0
)
||
(
nLength
<
(
24
+
8
*
nSubTables
))
)
return
false
;
return
false
;
const
unsigned
char
*
pEndValidArea
=
pCmap
+
nLength
;
// find the most interesting subtable in the CMAP
// find the most interesting subtable in the CMAP
rtl_TextEncoding
eRecodeFrom
=
RTL_TEXTENCODING_UNICODE
;
rtl_TextEncoding
eRecodeFrom
=
RTL_TEXTENCODING_UNICODE
;
int
nOffset
=
0
;
int
nOffset
=
0
;
...
@@ -198,8 +200,6 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
...
@@ -198,8 +200,6 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
SAL_WARN
(
"vcl.gdi"
,
"Format 4 char should not be 0xFFFF"
);
SAL_WARN
(
"vcl.gdi"
,
"Format 4 char should not be 0xFFFF"
);
break
;
break
;
}
}
*
(
pCP
++
)
=
cMinChar
;
*
(
pCP
++
)
=
cMaxChar
+
1
;
if
(
!
nRangeOffset
)
{
if
(
!
nRangeOffset
)
{
// glyphid can be calculated directly
// glyphid can be calculated directly
pStartGlyphs
[
i
]
=
(
cMinChar
+
nGlyphDelta
)
&
0xFFFF
;
pStartGlyphs
[
i
]
=
(
cMinChar
+
nGlyphDelta
)
&
0xFFFF
;
...
@@ -207,11 +207,20 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
...
@@ -207,11 +207,20 @@ bool ParseCMAP( const unsigned char* pCmap, int nLength, CmapResult& rResult )
// update the glyphid-array with the glyphs in this range
// update the glyphid-array with the glyphs in this range
pStartGlyphs
[
i
]
=
-
(
int
)
aGlyphIdArray
.
size
();
pStartGlyphs
[
i
]
=
-
(
int
)
aGlyphIdArray
.
size
();
const
unsigned
char
*
pGlyphIdPtr
=
pOffsetBase
+
2
*
i
+
nRangeOffset
;
const
unsigned
char
*
pGlyphIdPtr
=
pOffsetBase
+
2
*
i
+
nRangeOffset
;
const
size_t
nRemainingSize
=
pEndValidArea
-
pGlyphIdPtr
;
const
size_t
nMaxPossibleRecords
=
nRemainingSize
/
2
;
const
size_t
nRequestedRecords
=
cMaxChar
-
cMinChar
+
1
;
if
(
nRequestedRecords
>
nMaxPossibleRecords
)
{
// no sane font should trigger this
SAL_WARN
(
"vcl.gdi"
,
"More indexes claimed that space available in font!"
);
break
;
}
for
(
sal_UCS4
c
=
cMinChar
;
c
<=
cMaxChar
;
++
c
,
pGlyphIdPtr
+=
2
)
{
for
(
sal_UCS4
c
=
cMinChar
;
c
<=
cMaxChar
;
++
c
,
pGlyphIdPtr
+=
2
)
{
const
int
nGlyphIndex
=
Getsal_uInt16
(
pGlyphIdPtr
)
+
nGlyphDelta
;
const
int
nGlyphIndex
=
Getsal_uInt16
(
pGlyphIdPtr
)
+
nGlyphDelta
;
aGlyphIdArray
.
push_back
(
static_cast
<
sal_uInt16
>
(
nGlyphIndex
)
);
aGlyphIdArray
.
push_back
(
static_cast
<
sal_uInt16
>
(
nGlyphIndex
)
);
}
}
}
}
*
(
pCP
++
)
=
cMinChar
;
*
(
pCP
++
)
=
cMaxChar
+
1
;
}
}
nRangeCount
=
(
pCP
-
pCodePairs
)
/
2
;
nRangeCount
=
(
pCP
-
pCodePairs
)
/
2
;
}
}
...
...
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