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
cd6241b5
Commit
cd6241b5
authored
Sep 08, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/truemotion2: use av_calloc() & av_malloc_array()
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
c54aa2fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
truemotion2.c
libavcodec/truemotion2.c
+12
-12
No files found.
libavcodec/truemotion2.c
View file @
cd6241b5
...
...
@@ -169,9 +169,9 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
/* allocate space for codes - it is exactly ceil(nodes / 2) entries */
huff
.
max_num
=
(
huff
.
nodes
+
1
)
>>
1
;
huff
.
nums
=
av_
mallocz
(
huff
.
max_num
*
sizeof
(
int
));
huff
.
bits
=
av_
mallocz
(
huff
.
max_num
*
sizeof
(
uint32_t
));
huff
.
lens
=
av_
mallocz
(
huff
.
max_num
*
sizeof
(
int
));
huff
.
nums
=
av_
calloc
(
huff
.
max_num
,
sizeof
(
int
));
huff
.
bits
=
av_
calloc
(
huff
.
max_num
,
sizeof
(
uint32_t
));
huff
.
lens
=
av_
calloc
(
huff
.
max_num
,
sizeof
(
int
));
if
(
!
huff
.
nums
||
!
huff
.
bits
||
!
huff
.
lens
)
{
res
=
AVERROR
(
ENOMEM
);
...
...
@@ -198,7 +198,7 @@ static int tm2_build_huff_table(TM2Context *ctx, TM2Codes *code)
else
{
code
->
bits
=
huff
.
max_bits
;
code
->
length
=
huff
.
max_num
;
code
->
recode
=
av_malloc
(
code
->
length
*
sizeof
(
int
));
code
->
recode
=
av_malloc
_array
(
code
->
length
,
sizeof
(
int
));
if
(
!
code
->
recode
)
{
res
=
AVERROR
(
ENOMEM
);
goto
fail
;
...
...
@@ -933,8 +933,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_dsputil_init
(
&
l
->
dsp
,
avctx
);
l
->
last
=
av_malloc
(
4
*
sizeof
(
*
l
->
last
)
*
(
w
>>
2
)
);
l
->
clast
=
av_malloc
(
4
*
sizeof
(
*
l
->
clast
)
*
(
w
>>
2
));
l
->
last
=
av_malloc
_array
(
w
>>
2
,
4
*
sizeof
(
*
l
->
last
)
);
l
->
clast
=
av_malloc
_array
(
w
>>
2
,
4
*
sizeof
(
*
l
->
clast
));
for
(
i
=
0
;
i
<
TM2_NUM_STREAMS
;
i
++
)
{
l
->
tokens
[
i
]
=
NULL
;
...
...
@@ -943,15 +943,15 @@ static av_cold int decode_init(AVCodecContext *avctx)
w
+=
8
;
h
+=
8
;
l
->
Y1_base
=
av_
mallocz
(
sizeof
(
*
l
->
Y1_base
)
*
w
*
h
);
l
->
Y2_base
=
av_
mallocz
(
sizeof
(
*
l
->
Y2_base
)
*
w
*
h
);
l
->
Y1_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
Y1_base
)
);
l
->
Y2_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
Y2_base
)
);
l
->
y_stride
=
w
;
w
=
(
w
+
1
)
>>
1
;
h
=
(
h
+
1
)
>>
1
;
l
->
U1_base
=
av_
mallocz
(
sizeof
(
*
l
->
U1_base
)
*
w
*
h
);
l
->
V1_base
=
av_
mallocz
(
sizeof
(
*
l
->
V1_base
)
*
w
*
h
);
l
->
U2_base
=
av_
mallocz
(
sizeof
(
*
l
->
U2_base
)
*
w
*
h
);
l
->
V2_base
=
av_
mallocz
(
sizeof
(
*
l
->
V1_base
)
*
w
*
h
);
l
->
U1_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
U1_base
)
);
l
->
V1_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
V1_base
)
);
l
->
U2_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
U2_base
)
);
l
->
V2_base
=
av_
calloc
(
w
*
h
,
sizeof
(
*
l
->
V1_base
)
);
l
->
uv_stride
=
w
;
l
->
cur
=
0
;
if
(
!
l
->
Y1_base
||
!
l
->
Y2_base
||
!
l
->
U1_base
||
...
...
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