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
91c5cf33
Commit
91c5cf33
authored
Jan 14, 2014
by
Jonathan Liu
Committed by
Alexandre Julliard
Jan 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Avoid wined3d_ftoa buffer overflow.
parent
509364e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+3
-3
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-2
utils.c
dlls/wined3d/utils.c
+3
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
91c5cf33
...
...
@@ -767,7 +767,7 @@ static void shader_arb_update_float_pixel_constants(struct wined3d_device *devic
static
void
shader_arb_append_imm_vec4
(
struct
wined3d_shader_buffer
*
buffer
,
const
float
*
values
)
{
char
str
[
4
][
1
6
];
char
str
[
4
][
1
7
];
wined3d_ftoa
(
values
[
0
],
str
[
0
]);
wined3d_ftoa
(
values
[
1
],
str
[
1
]);
...
...
@@ -3605,7 +3605,7 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
BOOL
custom_linear_fog
=
FALSE
;
char
srgbtmp
[
4
][
4
];
char
ftoa_tmp
[
1
6
];
char
ftoa_tmp
[
1
7
];
unsigned
int
i
,
found
=
0
;
for
(
i
=
0
,
map
=
reg_maps
->
temporary
;
map
;
map
>>=
1
,
++
i
)
...
...
@@ -4220,7 +4220,7 @@ static GLuint shader_arb_generate_vshader(const struct wined3d_shader *shader,
shader_addline
(
buffer
,
"TEMP TMP_FOGCOORD;
\n
"
);
if
(
need_helper_const
(
shader_data
,
reg_maps
,
gl_info
))
{
char
ftoa_tmp
[
1
6
];
char
ftoa_tmp
[
1
7
];
wined3d_ftoa
(
eps
,
ftoa_tmp
);
shader_addline
(
buffer
,
"PARAM helper_const = { 0.0, 1.0, 2.0, %s};
\n
"
,
ftoa_tmp
);
}
...
...
dlls/wined3d/glsl_shader.c
View file @
91c5cf33
...
...
@@ -250,7 +250,7 @@ static const char *shader_glsl_get_prefix(enum wined3d_shader_type type)
static
void
shader_glsl_append_imm_vec4
(
struct
wined3d_shader_buffer
*
buffer
,
const
float
*
values
)
{
char
str
[
4
][
1
6
];
char
str
[
4
][
1
7
];
wined3d_ftoa
(
values
[
0
],
str
[
0
]);
wined3d_ftoa
(
values
[
1
],
str
[
1
]);
...
...
@@ -1415,7 +1415,7 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
const
struct
wined3d_gl_info
*
gl_info
=
ins
->
ctx
->
gl_info
;
const
char
*
prefix
=
shader_glsl_get_prefix
(
version
->
type
);
struct
glsl_src_param
rel_param0
,
rel_param1
;
char
imm_str
[
4
][
1
6
];
char
imm_str
[
4
][
1
7
];
if
(
reg
->
idx
[
0
].
offset
!=
~
0U
&&
reg
->
idx
[
0
].
rel_addr
)
shader_glsl_add_src_param
(
ins
,
reg
->
idx
[
0
].
rel_addr
,
WINED3DSP_WRITEMASK_0
,
&
rel_param0
);
...
...
dlls/wined3d/utils.c
View file @
91c5cf33
...
...
@@ -3814,6 +3814,9 @@ void wined3d_ftoa(float value, char *s)
if
(
copysignf
(
1
.
0
f
,
value
)
<
0
.
0
f
)
++
idx
;
/* Be sure to allocate a buffer of at least 17 characters for the result
as sprintf may return a 3 digit exponent when using the MSVC runtime
instead of a 2 digit exponent. */
sprintf
(
s
,
"%.8e"
,
value
);
if
(
isfinite
(
value
))
s
[
idx
]
=
'.'
;
...
...
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