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
732692d9
Commit
732692d9
authored
Aug 13, 2006
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trying to fix av_realloc()
Originally committed as revision 5996 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
0ccd1bb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
mem.c
libavutil/mem.c
+5
-3
No files found.
libavutil/mem.c
View file @
732692d9
...
...
@@ -50,7 +50,7 @@ void *av_malloc(unsigned int size)
#endif
/* let's disallow possible ambiguous cases */
if
(
size
>
(
INT_MAX
-
16
)
)
if
(
size
>
(
INT_MAX
-
16
)
||
!
size
)
return
NULL
;
#ifdef MEMALIGN_HACK
...
...
@@ -109,14 +109,16 @@ void *av_realloc(void *ptr, unsigned int size)
#ifndef MEMALIGN_HACK
ptr
=
realloc
(
ptr
,
size
);
if
(((
int
)
ptr
&
15
)
||
!
ptr
)
assert
(((
int
)((
void
*
)
0
)
&
15
)
==
0
);
//for the null pointer pedants
if
(
!
((
int
)
ptr
&
15
))
return
ptr
;
#endif
ptr2
=
av_malloc
(
size
);
if
(
ptr
&&
ptr2
)
memcpy
(
ptr2
,
ptr
,
size
);
av_free
(
ptr
);
if
(
ptr2
||
!
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