Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3e035ddf
Commit
3e035ddf
authored
Dec 12, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Don't leak memory on failure in allocate_shader_constants().
parent
7d29aecd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
stateblock.c
dlls/wined3d/stateblock.c
+21
-10
No files found.
dlls/wined3d/stateblock.c
View file @
3e035ddf
...
...
@@ -38,28 +38,39 @@ HRESULT allocate_shader_constants(IWineD3DStateBlockImpl* object) {
IWineD3DStateBlockImpl
*
This
=
object
;
#define WINED3D_MEMCHECK(_object) if (NULL == _object) { FIXME("Out of memory!\n"); return E_OUTOFMEMORY; }
/* Allocate space for floating point constants */
object
->
pixelShaderConstantF
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
float
)
*
GL_LIMITS
(
pshader_constantsF
)
*
4
);
WINED3D_MEMCHECK
(
object
->
pixelShaderConstantF
);
if
(
!
object
->
pixelShaderConstantF
)
goto
fail
;
object
->
changed
.
pixelShaderConstantsF
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
BOOL
)
*
GL_LIMITS
(
pshader_constantsF
));
WINED3D_MEMCHECK
(
object
->
changed
.
pixelShaderConstantsF
);
if
(
!
object
->
changed
.
pixelShaderConstantsF
)
goto
fail
;
object
->
vertexShaderConstantF
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
float
)
*
GL_LIMITS
(
vshader_constantsF
)
*
4
);
WINED3D_MEMCHECK
(
object
->
vertexShaderConstantF
);
if
(
!
object
->
vertexShaderConstantF
)
goto
fail
;
object
->
changed
.
vertexShaderConstantsF
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
BOOL
)
*
GL_LIMITS
(
vshader_constantsF
));
WINED3D_MEMCHECK
(
object
->
changed
.
vertexShaderConstantsF
);
if
(
!
object
->
changed
.
vertexShaderConstantsF
)
goto
fail
;
object
->
contained_vs_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
)
*
GL_LIMITS
(
vshader_constantsF
));
WINED3D_MEMCHECK
(
object
->
contained_vs_consts_f
);
if
(
!
object
->
contained_vs_consts_f
)
goto
fail
;
object
->
contained_ps_consts_f
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
DWORD
)
*
GL_LIMITS
(
pshader_constantsF
));
WINED3D_MEMCHECK
(
object
->
contained_ps_consts_f
)
;
if
(
!
object
->
contained_ps_consts_f
)
goto
fail
;
list_init
(
&
object
->
set_vconstantsF
);
list_init
(
&
object
->
set_pconstantsF
);
#undef WINED3D_MEMCHECK
return
WINED3D_OK
;
fail:
ERR
(
"Failed to allocate memory
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
pixelShaderConstantF
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
changed
.
pixelShaderConstantsF
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
vertexShaderConstantF
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
changed
.
vertexShaderConstantsF
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
contained_vs_consts_f
);
HeapFree
(
GetProcessHeap
(),
0
,
object
->
contained_ps_consts_f
);
return
E_OUTOFMEMORY
;
}
/** Copy all members of one stateblock to another */
...
...
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