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
4615ff0d
Commit
4615ff0d
authored
Apr 15, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/frame: use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
eead2cdd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
frame.c
libavutil/frame.c
+4
-4
No files found.
libavutil/frame.c
View file @
4615ff0d
...
@@ -204,9 +204,9 @@ static int get_audio_buffer(AVFrame *frame, int align)
...
@@ -204,9 +204,9 @@ static int get_audio_buffer(AVFrame *frame, int align)
}
}
if
(
planes
>
AV_NUM_DATA_POINTERS
)
{
if
(
planes
>
AV_NUM_DATA_POINTERS
)
{
frame
->
extended_data
=
av_mallocz
(
planes
*
frame
->
extended_data
=
av_mallocz
_array
(
planes
,
sizeof
(
*
frame
->
extended_data
));
sizeof
(
*
frame
->
extended_data
));
frame
->
extended_buf
=
av_mallocz
((
planes
-
AV_NUM_DATA_POINTERS
)
*
frame
->
extended_buf
=
av_mallocz
_array
((
planes
-
AV_NUM_DATA_POINTERS
),
sizeof
(
*
frame
->
extended_buf
));
sizeof
(
*
frame
->
extended_buf
));
if
(
!
frame
->
extended_data
||
!
frame
->
extended_buf
)
{
if
(
!
frame
->
extended_data
||
!
frame
->
extended_buf
)
{
av_freep
(
&
frame
->
extended_data
);
av_freep
(
&
frame
->
extended_data
);
...
@@ -290,7 +290,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
...
@@ -290,7 +290,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
}
}
if
(
src
->
extended_buf
)
{
if
(
src
->
extended_buf
)
{
dst
->
extended_buf
=
av_mallocz
(
sizeof
(
*
dst
->
extended_buf
)
*
dst
->
extended_buf
=
av_mallocz
_array
(
sizeof
(
*
dst
->
extended_buf
),
src
->
nb_extended_buf
);
src
->
nb_extended_buf
);
if
(
!
dst
->
extended_buf
)
{
if
(
!
dst
->
extended_buf
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
...
@@ -317,7 +317,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
...
@@ -317,7 +317,7 @@ int av_frame_ref(AVFrame *dst, const AVFrame *src)
}
}
CHECK_CHANNELS_CONSISTENCY
(
src
);
CHECK_CHANNELS_CONSISTENCY
(
src
);
dst
->
extended_data
=
av_malloc
(
sizeof
(
*
dst
->
extended_data
)
*
ch
);
dst
->
extended_data
=
av_malloc
_array
(
sizeof
(
*
dst
->
extended_data
),
ch
);
if
(
!
dst
->
extended_data
)
{
if
(
!
dst
->
extended_data
)
{
ret
=
AVERROR
(
ENOMEM
);
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
goto
fail
;
...
...
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