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
aefb99f2
Commit
aefb99f2
authored
Jan 09, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ass_split: use *alloc_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
727cb2bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ass_split.c
libavcodec/ass_split.c
+3
-3
No files found.
libavcodec/ass_split.c
View file @
aefb99f2
...
@@ -207,7 +207,7 @@ static uint8_t *realloc_section_array(ASSSplitContext *ctx)
...
@@ -207,7 +207,7 @@ static uint8_t *realloc_section_array(ASSSplitContext *ctx)
const
ASSSection
*
section
=
&
ass_sections
[
ctx
->
current_section
];
const
ASSSection
*
section
=
&
ass_sections
[
ctx
->
current_section
];
int
*
count
=
(
int
*
)((
uint8_t
*
)
&
ctx
->
ass
+
section
->
offset_count
);
int
*
count
=
(
int
*
)((
uint8_t
*
)
&
ctx
->
ass
+
section
->
offset_count
);
void
**
section_ptr
=
(
void
**
)((
uint8_t
*
)
&
ctx
->
ass
+
section
->
offset
);
void
**
section_ptr
=
(
void
**
)((
uint8_t
*
)
&
ctx
->
ass
+
section
->
offset
);
uint8_t
*
tmp
=
av_realloc
(
*
section_ptr
,
(
*
count
+
1
)
*
section
->
size
);
uint8_t
*
tmp
=
av_realloc
_array
(
*
section_ptr
,
(
*
count
+
1
),
section
->
size
);
if
(
!
tmp
)
if
(
!
tmp
)
return
NULL
;
return
NULL
;
*
section_ptr
=
tmp
;
*
section_ptr
=
tmp
;
...
@@ -232,7 +232,7 @@ static inline const char *skip_space(const char *buf)
...
@@ -232,7 +232,7 @@ static inline const char *skip_space(const char *buf)
static
int
*
get_default_field_orders
(
const
ASSSection
*
section
)
static
int
*
get_default_field_orders
(
const
ASSSection
*
section
)
{
{
int
i
;
int
i
;
int
*
order
=
av_malloc
(
FF_ARRAY_ELEMS
(
section
->
fields
)
*
sizeof
(
*
order
));
int
*
order
=
av_malloc
_array
(
FF_ARRAY_ELEMS
(
section
->
fields
),
sizeof
(
*
order
));
if
(
!
order
)
if
(
!
order
)
return
NULL
;
return
NULL
;
...
@@ -265,7 +265,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
...
@@ -265,7 +265,7 @@ static const char *ass_split_section(ASSSplitContext *ctx, const char *buf)
while
(
!
is_eol
(
*
buf
))
{
while
(
!
is_eol
(
*
buf
))
{
buf
=
skip_space
(
buf
);
buf
=
skip_space
(
buf
);
len
=
strcspn
(
buf
,
",
\r\n
"
);
len
=
strcspn
(
buf
,
",
\r\n
"
);
if
(
!
(
tmp
=
av_realloc
(
order
,
(
*
number
+
1
)
*
sizeof
(
*
order
))))
if
(
!
(
tmp
=
av_realloc
_array
(
order
,
(
*
number
+
1
),
sizeof
(
*
order
))))
return
NULL
;
return
NULL
;
order
=
tmp
;
order
=
tmp
;
order
[
*
number
]
=
-
1
;
order
[
*
number
]
=
-
1
;
...
...
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