Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
75c413ae
Commit
75c413ae
authored
Aug 13, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
align av_realloc()
Originally committed as revision 5992 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4bff9ef9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
mem.c
libavutil/mem.c
+12
-10
No files found.
libavutil/mem.c
View file @
75c413ae
...
...
@@ -101,22 +101,24 @@ void *av_malloc(unsigned int size)
*/
void
*
av_realloc
(
void
*
ptr
,
unsigned
int
size
)
{
#ifdef MEMALIGN_HACK
int
diff
;
#endif
void
*
ptr2
;
/* let's disallow possible ambiguous cases */
if
(
size
>
(
INT_MAX
-
16
)
)
return
NULL
;
#ifdef MEMALIGN_HACK
//FIXME this isn't aligned correctly, though it probably isn't needed
if
(
!
ptr
)
return
av_malloc
(
size
);
diff
=
((
char
*
)
ptr
)[
-
1
];
return
realloc
(
ptr
-
diff
,
size
+
diff
)
+
diff
;
#else
return
realloc
(
ptr
,
size
);
#ifndef MEMALIGN_HACK
ptr
=
realloc
(
ptr
,
size
);
if
(((
int
)
ptr
&
15
)
||
!
ptr
)
return
ptr
;
#endif
ptr2
=
av_malloc
(
size
);
if
(
ptr
&&
ptr2
)
memcpy
(
ptr2
,
ptr
,
size
);
av_free
(
ptr
);
return
ptr2
;
}
/**
...
...
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