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
695b1d81
Commit
695b1d81
authored
Jan 02, 2018
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavu/mem: Allow allocations close to max_alloc_size with av_fast_realloc().
parent
f141b353
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
mem.c
libavutil/mem.c
+6
-1
No files found.
libavutil/mem.c
View file @
695b1d81
...
...
@@ -466,7 +466,12 @@ void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
if
(
min_size
<=
*
size
)
return
ptr
;
min_size
=
FFMAX
(
min_size
+
min_size
/
16
+
32
,
min_size
);
if
(
min_size
>
max_alloc_size
-
32
)
{
*
size
=
0
;
return
NULL
;
}
min_size
=
FFMIN
(
max_alloc_size
-
32
,
FFMAX
(
min_size
+
min_size
/
16
+
32
,
min_size
));
ptr
=
av_realloc
(
ptr
,
min_size
);
/* we could set this to the unmodified min_size but this is safer
...
...
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