Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3ac3a5dc
Commit
3ac3a5dc
authored
Oct 24, 2007
by
Alexander Dorofeyev
Committed by
Alexandre Julliard
Oct 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Fix unchecked NULL ptr in BIDI_Reorder.
parent
5edd2cfa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
bidi.c
dlls/gdi32/bidi.c
+13
-7
No files found.
dlls/gdi32/bidi.c
View file @
3ac3a5dc
...
@@ -831,7 +831,7 @@ static void resolveImplicit(const WORD * pcls, WORD *plevel, int cch)
...
@@ -831,7 +831,7 @@ static void resolveImplicit(const WORD * pcls, WORD *plevel, int cch)
occurs after the character in pszInput[n]. Breaks before the first
occurs after the character in pszInput[n]. Breaks before the first
character are not allowed.
character are not allowed.
------------------------------------------------------------------------*/
------------------------------------------------------------------------*/
static
int
resolveLines
(
WCHAR
*
pszInput
,
BOOL
*
pbrk
,
int
cch
)
static
int
resolveLines
(
LPCWSTR
pszInput
,
BOOL
*
pbrk
,
int
cch
)
{
{
/* skip characters not of type LS */
/* skip characters not of type LS */
int
ich
=
0
;
int
ich
=
0
;
...
@@ -1012,7 +1012,8 @@ static void mirror(LPWSTR pszInput, const WORD* plevel, int cch)
...
@@ -1012,7 +1012,8 @@ static void mirror(LPWSTR pszInput, const WORD* plevel, int cch)
Array of levels
Array of levels
------------------------------------------------------------------------*/
------------------------------------------------------------------------*/
static
void
BidiLines
(
int
baselevel
,
WCHAR
*
pszLine
,
WORD
*
pclsLine
,
WORD
*
plevelLine
,
int
cchPara
,
int
fMirror
,
BOOL
*
pbrk
)
static
void
BidiLines
(
int
baselevel
,
LPWSTR
pszOutLine
,
LPCWSTR
pszLine
,
WORD
*
pclsLine
,
WORD
*
plevelLine
,
int
cchPara
,
int
fMirror
,
BOOL
*
pbrk
)
{
{
int
cchLine
=
0
;
int
cchLine
=
0
;
...
@@ -1024,11 +1025,14 @@ static void BidiLines(int baselevel, WCHAR * pszLine, WORD * pclsLine, WORD * pl
...
@@ -1024,11 +1025,14 @@ static void BidiLines(int baselevel, WCHAR * pszLine, WORD * pclsLine, WORD * pl
/* resolve whitespace */
/* resolve whitespace */
resolveWhitespace
(
baselevel
,
pclsLine
,
plevelLine
,
cchLine
);
resolveWhitespace
(
baselevel
,
pclsLine
,
plevelLine
,
cchLine
);
if
(
pszOutLine
)
{
if
(
fMirror
)
if
(
fMirror
)
mirror
(
psz
Line
,
plevelLine
,
cchLine
);
mirror
(
pszOut
Line
,
plevelLine
,
cchLine
);
/* reorder each line in place */
/* reorder each line in place */
reorder
(
baselevel
,
pszLine
,
plevelLine
,
cchLine
);
reorder
(
baselevel
,
pszOutLine
,
plevelLine
,
cchLine
);
}
pszLine
+=
cchLine
;
pszLine
+=
cchLine
;
plevelLine
+=
cchLine
;
plevelLine
+=
cchLine
;
...
@@ -1079,6 +1083,7 @@ BOOL BIDI_Reorder(
...
@@ -1079,6 +1083,7 @@ BOOL BIDI_Reorder(
return
FALSE
;
return
FALSE
;
}
}
if
(
lpOutString
)
memcpy
(
lpOutString
,
lpString
,
uCount
*
sizeof
(
WCHAR
));
memcpy
(
lpOutString
,
lpString
,
uCount
*
sizeof
(
WCHAR
));
if
(
WINE_GCPW_FORCE_RTL
==
(
dwWineGCP_Flags
&
WINE_GCPW_DIR_MASK
))
if
(
WINE_GCPW_FORCE_RTL
==
(
dwWineGCP_Flags
&
WINE_GCPW_DIR_MASK
))
...
@@ -1088,7 +1093,7 @@ BOOL BIDI_Reorder(
...
@@ -1088,7 +1093,7 @@ BOOL BIDI_Reorder(
while
(
done
<
uCount
)
while
(
done
<
uCount
)
{
{
unsigned
j
;
unsigned
j
;
classify
(
lp
Out
String
+
done
,
chartype
,
uCount
-
done
);
classify
(
lpString
+
done
,
chartype
,
uCount
-
done
);
/* limit text to first block */
/* limit text to first block */
i
=
resolveParagraphs
(
chartype
,
uCount
-
done
);
i
=
resolveParagraphs
(
chartype
,
uCount
-
done
);
for
(
j
=
0
;
j
<
i
;
++
j
)
for
(
j
=
0
;
j
<
i
;
++
j
)
...
@@ -1134,9 +1139,10 @@ BOOL BIDI_Reorder(
...
@@ -1134,9 +1139,10 @@ BOOL BIDI_Reorder(
resolveImplicit
(
chartype
,
levels
,
i
);
resolveImplicit
(
chartype
,
levels
,
i
);
/* assign directional types again, but for WS, S this time */
/* assign directional types again, but for WS, S this time */
classify
(
lp
Out
String
+
done
,
chartype
,
i
);
classify
(
lpString
+
done
,
chartype
,
i
);
BidiLines
(
baselevel
,
lpOutString
+
done
,
chartype
,
levels
,
i
,
!
(
dwFlags
&
GCP_SYMSWAPOFF
),
0
);
BidiLines
(
baselevel
,
lpOutString
?
lpOutString
+
done
:
NULL
,
lpString
+
done
,
chartype
,
levels
,
i
,
!
(
dwFlags
&
GCP_SYMSWAPOFF
),
0
);
if
(
lpOrder
)
if
(
lpOrder
)
{
{
...
...
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