Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
46a8f555
Commit
46a8f555
authored
Jun 21, 2012
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
block_Release(): add one more sanity check
parent
a2314241
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/misc/block.c
src/misc/block.c
+4
-2
No files found.
src/misc/block.c
View file @
46a8f555
...
@@ -99,8 +99,10 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
...
@@ -99,8 +99,10 @@ void block_Init( block_t *restrict b, void *buf, size_t size )
#endif
#endif
}
}
static
void
Block
Release
(
block_t
*
block
)
static
void
block_generic_
Release
(
block_t
*
block
)
{
{
/* That is always true for blocks allocated with block_Alloc(). */
assert
(
block
->
p_start
==
(
unsigned
char
*
)(
block
+
1
));
block_Invalidate
(
block
);
block_Invalidate
(
block
);
free
(
block
);
free
(
block
);
}
}
...
@@ -140,7 +142,7 @@ block_t *block_Alloc (size_t size)
...
@@ -140,7 +142,7 @@ block_t *block_Alloc (size_t size)
b
->
p_buffer
+=
BLOCK_PADDING
+
BLOCK_ALIGN
-
1
;
b
->
p_buffer
+=
BLOCK_PADDING
+
BLOCK_ALIGN
-
1
;
b
->
p_buffer
=
(
void
*
)(((
uintptr_t
)
b
->
p_buffer
)
&
~
(
BLOCK_ALIGN
-
1
));
b
->
p_buffer
=
(
void
*
)(((
uintptr_t
)
b
->
p_buffer
)
&
~
(
BLOCK_ALIGN
-
1
));
b
->
i_buffer
=
size
;
b
->
i_buffer
=
size
;
b
->
pf_release
=
Block
Release
;
b
->
pf_release
=
block_generic_
Release
;
return
b
;
return
b
;
}
}
...
...
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