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
7faa7d3d
Commit
7faa7d3d
authored
Jul 01, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/hevc: Use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
80da227c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
hevc.c
libavcodec/hevc.c
+11
-11
No files found.
libavcodec/hevc.c
View file @
7faa7d3d
...
@@ -100,26 +100,26 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
...
@@ -100,26 +100,26 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
goto
fail
;
goto
fail
;
s
->
skip_flag
=
av_malloc
(
pic_size_in_ctb
);
s
->
skip_flag
=
av_malloc
(
pic_size_in_ctb
);
s
->
tab_ct_depth
=
av_malloc
(
sps
->
min_cb_height
*
sps
->
min_cb_width
);
s
->
tab_ct_depth
=
av_malloc
_array
(
sps
->
min_cb_height
,
sps
->
min_cb_width
);
if
(
!
s
->
skip_flag
||
!
s
->
tab_ct_depth
)
if
(
!
s
->
skip_flag
||
!
s
->
tab_ct_depth
)
goto
fail
;
goto
fail
;
s
->
cbf_luma
=
av_malloc
(
sps
->
min_tb_width
*
sps
->
min_tb_height
);
s
->
cbf_luma
=
av_malloc
_array
(
sps
->
min_tb_width
,
sps
->
min_tb_height
);
s
->
tab_ipm
=
av_mallocz
(
min_pu_size
);
s
->
tab_ipm
=
av_mallocz
(
min_pu_size
);
s
->
is_pcm
=
av_malloc
(
min_pu_size
);
s
->
is_pcm
=
av_malloc
(
min_pu_size
);
if
(
!
s
->
tab_ipm
||
!
s
->
cbf_luma
||
!
s
->
is_pcm
)
if
(
!
s
->
tab_ipm
||
!
s
->
cbf_luma
||
!
s
->
is_pcm
)
goto
fail
;
goto
fail
;
s
->
filter_slice_edges
=
av_malloc
(
ctb_count
);
s
->
filter_slice_edges
=
av_malloc
(
ctb_count
);
s
->
tab_slice_address
=
av_malloc
(
pic_size_in_ctb
*
s
->
tab_slice_address
=
av_malloc
_array
(
pic_size_in_ctb
,
sizeof
(
*
s
->
tab_slice_address
));
sizeof
(
*
s
->
tab_slice_address
));
s
->
qp_y_tab
=
av_malloc
(
pic_size_in_ctb
*
s
->
qp_y_tab
=
av_malloc
_array
(
pic_size_in_ctb
,
sizeof
(
*
s
->
qp_y_tab
));
sizeof
(
*
s
->
qp_y_tab
));
if
(
!
s
->
qp_y_tab
||
!
s
->
filter_slice_edges
||
!
s
->
tab_slice_address
)
if
(
!
s
->
qp_y_tab
||
!
s
->
filter_slice_edges
||
!
s
->
tab_slice_address
)
goto
fail
;
goto
fail
;
s
->
horizontal_bs
=
av_mallocz
(
2
*
s
->
bs_width
*
(
s
->
bs_height
+
1
));
s
->
horizontal_bs
=
av_mallocz
_array
(
2
*
s
->
bs_width
,
(
s
->
bs_height
+
1
));
s
->
vertical_bs
=
av_mallocz
(
2
*
s
->
bs_width
*
(
s
->
bs_height
+
1
));
s
->
vertical_bs
=
av_mallocz
_array
(
2
*
s
->
bs_width
,
(
s
->
bs_height
+
1
));
if
(
!
s
->
horizontal_bs
||
!
s
->
vertical_bs
)
if
(
!
s
->
horizontal_bs
||
!
s
->
vertical_bs
)
goto
fail
;
goto
fail
;
...
@@ -675,9 +675,9 @@ static int hls_slice_header(HEVCContext *s)
...
@@ -675,9 +675,9 @@ static int hls_slice_header(HEVCContext *s)
av_freep
(
&
sh
->
entry_point_offset
);
av_freep
(
&
sh
->
entry_point_offset
);
av_freep
(
&
sh
->
offset
);
av_freep
(
&
sh
->
offset
);
av_freep
(
&
sh
->
size
);
av_freep
(
&
sh
->
size
);
sh
->
entry_point_offset
=
av_malloc
(
sh
->
num_entry_point_offsets
*
sizeof
(
int
));
sh
->
entry_point_offset
=
av_malloc
_array
(
sh
->
num_entry_point_offsets
,
sizeof
(
int
));
sh
->
offset
=
av_malloc
(
sh
->
num_entry_point_offsets
*
sizeof
(
int
));
sh
->
offset
=
av_malloc
_array
(
sh
->
num_entry_point_offsets
,
sizeof
(
int
));
sh
->
size
=
av_malloc
(
sh
->
num_entry_point_offsets
*
sizeof
(
int
));
sh
->
size
=
av_malloc
_array
(
sh
->
num_entry_point_offsets
,
sizeof
(
int
));
if
(
!
sh
->
entry_point_offset
||
!
sh
->
offset
||
!
sh
->
size
)
{
if
(
!
sh
->
entry_point_offset
||
!
sh
->
offset
||
!
sh
->
size
)
{
sh
->
num_entry_point_offsets
=
0
;
sh
->
num_entry_point_offsets
=
0
;
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Failed to allocate memory
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"Failed to allocate memory
\n
"
);
...
@@ -2179,8 +2179,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
...
@@ -2179,8 +2179,8 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int
static
int
hls_slice_data_wpp
(
HEVCContext
*
s
,
const
uint8_t
*
nal
,
int
length
)
static
int
hls_slice_data_wpp
(
HEVCContext
*
s
,
const
uint8_t
*
nal
,
int
length
)
{
{
HEVCLocalContext
*
lc
=
s
->
HEVClc
;
HEVCLocalContext
*
lc
=
s
->
HEVClc
;
int
*
ret
=
av_malloc
((
s
->
sh
.
num_entry_point_offsets
+
1
)
*
sizeof
(
int
));
int
*
ret
=
av_malloc
_array
(
s
->
sh
.
num_entry_point_offsets
+
1
,
sizeof
(
int
));
int
*
arg
=
av_malloc
((
s
->
sh
.
num_entry_point_offsets
+
1
)
*
sizeof
(
int
));
int
*
arg
=
av_malloc
_array
(
s
->
sh
.
num_entry_point_offsets
+
1
,
sizeof
(
int
));
int
offset
;
int
offset
;
int
startheader
,
cmpt
=
0
;
int
startheader
,
cmpt
=
0
;
int
i
,
j
,
res
=
0
;
int
i
,
j
,
res
=
0
;
...
...
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