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
8653419e
Commit
8653419e
authored
Nov 30, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mxfdec: Reset structural_components_count when allocation fails
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e5d217f0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
mxfdec.c
libavformat/mxfdec.c
+6
-2
No files found.
libavformat/mxfdec.c
View file @
8653419e
...
...
@@ -742,8 +742,10 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID
case
0x1001
:
sequence
->
structural_components_count
=
avio_rb32
(
pb
);
sequence
->
structural_components_refs
=
av_calloc
(
sequence
->
structural_components_count
,
sizeof
(
UID
));
if
(
!
sequence
->
structural_components_refs
)
if
(
!
sequence
->
structural_components_refs
)
{
sequence
->
structural_components_count
=
0
;
return
AVERROR
(
ENOMEM
);
}
avio_skip
(
pb
,
4
);
/* useless size of objects, always 16 according to specs */
avio_read
(
pb
,
(
uint8_t
*
)
sequence
->
structural_components_refs
,
sequence
->
structural_components_count
*
sizeof
(
UID
));
break
;
...
...
@@ -761,8 +763,10 @@ static int mxf_read_essence_group(void *arg, AVIOContext *pb, int tag, int size,
case
0x0501
:
essence_group
->
structural_components_count
=
avio_rb32
(
pb
);
essence_group
->
structural_components_refs
=
av_calloc
(
essence_group
->
structural_components_count
,
sizeof
(
UID
));
if
(
!
essence_group
->
structural_components_refs
)
if
(
!
essence_group
->
structural_components_refs
)
{
essence_group
->
structural_components_count
=
0
;
return
AVERROR
(
ENOMEM
);
}
avio_skip
(
pb
,
4
);
/* useless size of objects, always 16 according to specs */
avio_read
(
pb
,
(
uint8_t
*
)
essence_group
->
structural_components_refs
,
essence_group
->
structural_components_count
*
sizeof
(
UID
));
break
;
...
...
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