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
0a7ad6bf
Commit
0a7ad6bf
authored
Jun 13, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/formats: Use av_realloc_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
d03eefae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
formats.c
libavfilter/formats.c
+6
-6
No files found.
libavfilter/formats.c
View file @
0a7ad6bf
...
...
@@ -39,8 +39,8 @@ do { \
type ***tmp; \
int i; \
\
if (!(tmp = av_realloc
(ret->refs,
\
sizeof(*tmp) * (ret->refcount + a->refcount))))
\
if (!(tmp = av_realloc
_array(ret->refs, ret->refcount + a->refcount,
\
sizeof(*tmp))))
\
goto fail; \
ret->refs = tmp; \
\
...
...
@@ -66,7 +66,7 @@ do {
goto fail; \
\
if (count) { \
if (!(ret->fmts = av_malloc
(sizeof(*ret->fmts) * count)))
\
if (!(ret->fmts = av_malloc
_array(count, sizeof(*ret->fmts))))
\
goto fail; \
for (i = 0; i < a->nb; i++) \
for (j = 0; j < b->nb; j++) \
...
...
@@ -196,8 +196,8 @@ AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
ret_max
=
a
->
nb_channel_layouts
+
b
->
nb_channel_layouts
;
if
(
!
(
ret
=
av_mallocz
(
sizeof
(
*
ret
)))
||
!
(
ret
->
channel_layouts
=
av_malloc
(
sizeof
(
*
ret
->
channel_layouts
)
*
ret_max
)))
!
(
ret
->
channel_layouts
=
av_malloc
_array
(
ret_max
,
sizeof
(
*
ret
->
channel_layouts
)
)))
goto
fail
;
/* a[known] intersect b[known] */
...
...
@@ -284,7 +284,7 @@ int ff_fmt_is_in(int fmt, const int *fmts)
if (!formats) return NULL; \
formats->count_field = count; \
if (count) { \
formats->field = av_malloc
(sizeof(*formats->field)*count
); \
formats->field = av_malloc
_array(count, sizeof(*formats->field)
); \
if (!formats->field) { \
av_free(formats); \
return NULL; \
...
...
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