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
e89f3d0e
Commit
e89f3d0e
authored
Apr 12, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ffv1: use av_malloc_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
713e62e9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ffv1.c
libavcodec/ffv1.c
+4
-4
No files found.
libavcodec/ffv1.c
View file @
e89f3d0e
...
...
@@ -75,13 +75,13 @@ av_cold int ffv1_init_slice_state(FFV1Context *f, FFV1Context *fs)
if
(
fs
->
ac
)
{
if
(
!
p
->
state
)
p
->
state
=
av_malloc
(
CONTEXT_SIZE
*
p
->
context_count
*
p
->
state
=
av_malloc
_array
(
p
->
context_count
,
CONTEXT_SIZE
*
sizeof
(
uint8_t
));
if
(
!
p
->
state
)
return
AVERROR
(
ENOMEM
);
}
else
{
if
(
!
p
->
vlc_state
)
p
->
vlc_state
=
av_malloc
(
p
->
context_count
*
sizeof
(
VlcState
));
p
->
vlc_state
=
av_malloc
_array
(
p
->
context_count
,
sizeof
(
VlcState
));
if
(
!
p
->
vlc_state
)
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -137,7 +137,7 @@ av_cold int ffv1_init_slice_contexts(FFV1Context *f)
fs
->
slice_x
=
sxs
;
fs
->
slice_y
=
sys
;
fs
->
sample_buffer
=
av_malloc
(
3
*
MAX_PLANES
*
(
fs
->
width
+
6
)
*
fs
->
sample_buffer
=
av_malloc
_array
((
fs
->
width
+
6
),
3
*
MAX_PLANES
*
sizeof
(
*
fs
->
sample_buffer
));
if
(
!
fs
->
sample_buffer
)
return
AVERROR
(
ENOMEM
);
...
...
@@ -150,7 +150,7 @@ int ffv1_allocate_initial_states(FFV1Context *f)
int
i
;
for
(
i
=
0
;
i
<
f
->
quant_table_count
;
i
++
)
{
f
->
initial_states
[
i
]
=
av_malloc
(
f
->
context_count
[
i
]
*
f
->
initial_states
[
i
]
=
av_malloc
_array
(
f
->
context_count
[
i
],
sizeof
(
*
f
->
initial_states
[
i
]));
if
(
!
f
->
initial_states
[
i
])
return
AVERROR
(
ENOMEM
);
...
...
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