Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
20ea14d0
Commit
20ea14d0
authored
Dec 21, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mxfdec: fix memleak on av_realloc failures
parent
fc857294
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
mxfdec.c
libavformat/mxfdec.c
+8
-5
No files found.
libavformat/mxfdec.c
View file @
20ea14d0
...
@@ -407,16 +407,17 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U
...
@@ -407,16 +407,17 @@ static int mxf_read_primer_pack(void *arg, AVIOContext *pb, int tag, int size, U
static
int
mxf_read_partition_pack
(
void
*
arg
,
AVIOContext
*
pb
,
int
tag
,
int
size
,
UID
uid
,
int64_t
klv_offset
)
static
int
mxf_read_partition_pack
(
void
*
arg
,
AVIOContext
*
pb
,
int
tag
,
int
size
,
UID
uid
,
int64_t
klv_offset
)
{
{
MXFContext
*
mxf
=
arg
;
MXFContext
*
mxf
=
arg
;
MXFPartition
*
partition
;
MXFPartition
*
partition
,
*
tmp_part
;
UID
op
;
UID
op
;
uint64_t
footer_partition
;
uint64_t
footer_partition
;
if
(
mxf
->
partitions_count
+
1
>=
UINT_MAX
/
sizeof
(
*
mxf
->
partitions
))
if
(
mxf
->
partitions_count
+
1
>=
UINT_MAX
/
sizeof
(
*
mxf
->
partitions
))
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
mxf
->
partitions
=
av_realloc
(
mxf
->
partitions
,
(
mxf
->
partitions_count
+
1
)
*
sizeof
(
*
mxf
->
partitions
));
tmp_part
=
av_realloc
(
mxf
->
partitions
,
(
mxf
->
partitions_count
+
1
)
*
sizeof
(
*
mxf
->
partitions
));
if
(
!
mxf
->
partitions
)
if
(
!
tmp_part
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
mxf
->
partitions
=
tmp_part
;
if
(
mxf
->
parsing_backward
)
{
if
(
mxf
->
parsing_backward
)
{
/* insert the new partition pack in the middle
/* insert the new partition pack in the middle
...
@@ -512,11 +513,13 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
...
@@ -512,11 +513,13 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size
static
int
mxf_add_metadata_set
(
MXFContext
*
mxf
,
void
*
metadata_set
)
static
int
mxf_add_metadata_set
(
MXFContext
*
mxf
,
void
*
metadata_set
)
{
{
MXFMetadataSet
**
tmp
;
if
(
mxf
->
metadata_sets_count
+
1
>=
UINT_MAX
/
sizeof
(
*
mxf
->
metadata_sets
))
if
(
mxf
->
metadata_sets_count
+
1
>=
UINT_MAX
/
sizeof
(
*
mxf
->
metadata_sets
))
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
mxf
->
metadata_sets
=
av_realloc
(
mxf
->
metadata_sets
,
(
mxf
->
metadata_sets_count
+
1
)
*
sizeof
(
*
mxf
->
metadata_sets
));
tmp
=
av_realloc
(
mxf
->
metadata_sets
,
(
mxf
->
metadata_sets_count
+
1
)
*
sizeof
(
*
mxf
->
metadata_sets
));
if
(
!
mxf
->
metadata_sets
)
if
(
!
tmp
)
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
mxf
->
metadata_sets
=
tmp
;
mxf
->
metadata_sets
[
mxf
->
metadata_sets_count
]
=
metadata_set
;
mxf
->
metadata_sets
[
mxf
->
metadata_sets_count
]
=
metadata_set
;
mxf
->
metadata_sets_count
++
;
mxf
->
metadata_sets_count
++
;
return
0
;
return
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