Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
c51d4c68
Commit
c51d4c68
authored
Mar 01, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix calloc usage
parent
1a5728ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
21 deletions
+25
-21
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+25
-21
No files found.
modules/demux/mp4/libmp4.c
View file @
c51d4c68
...
...
@@ -763,9 +763,9 @@ static int MP4_ReadBox_stts( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_stts
->
i_entry_count
);
p_box
->
data
.
p_stts
->
i_sample_count
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stts
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stts
->
i_entry_count
,
sizeof
(
uint32_t
)
);
p_box
->
data
.
p_stts
->
i_sample_delta
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stts
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stts
->
i_entry_count
,
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
(
i
<
p_box
->
data
.
p_stts
->
i_entry_count
)
&&
(
i_read
>=
8
);
i
++
)
{
...
...
@@ -797,9 +797,9 @@ static int MP4_ReadBox_ctts( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_ctts
->
i_entry_count
);
p_box
->
data
.
p_ctts
->
i_sample_count
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_ctts
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_ctts
->
i_entry_count
,
sizeof
(
uint32_t
)
);
p_box
->
data
.
p_ctts
->
i_sample_offset
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_ctts
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_ctts
->
i_entry_count
,
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
(
i
<
p_box
->
data
.
p_ctts
->
i_entry_count
)
&&
(
i_read
>=
8
);
i
++
)
{
...
...
@@ -1429,7 +1429,7 @@ static int MP4_ReadBox_stsz( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_stsz
->
i_sample_count
);
p_box
->
data
.
p_stsz
->
i_entry_size
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsz
->
i_sample_count
);
calloc
(
p_box
->
data
.
p_stsz
->
i_sample_count
,
sizeof
(
uint32_t
)
);
if
(
!
p_box
->
data
.
p_stsz
->
i_sample_size
)
{
...
...
@@ -1464,11 +1464,11 @@ static int MP4_ReadBox_stsc( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_stsc
->
i_entry_count
);
p_box
->
data
.
p_stsc
->
i_first_chunk
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsc
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stsc
->
i_entry_count
,
sizeof
(
uint32_t
)
);
p_box
->
data
.
p_stsc
->
i_samples_per_chunk
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsc
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stsc
->
i_entry_count
,
sizeof
(
uint32_t
)
);
p_box
->
data
.
p_stsc
->
i_sample_description_index
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsc
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stsc
->
i_entry_count
,
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
(
i
<
p_box
->
data
.
p_stsc
->
i_entry_count
)
&&
(
i_read
>=
12
);
i
++
)
{
...
...
@@ -1503,7 +1503,7 @@ static int MP4_ReadBox_stco_co64( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_co64
->
i_entry_count
);
p_box
->
data
.
p_co64
->
i_chunk_offset
=
calloc
(
sizeof
(
uint64_t
),
p_box
->
data
.
p_co64
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_co64
->
i_entry_count
,
sizeof
(
uint64_t
)
);
for
(
i
=
0
;
i
<
p_box
->
data
.
p_co64
->
i_entry_count
;
i
++
)
{
...
...
@@ -1549,7 +1549,7 @@ static int MP4_ReadBox_stss( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_stss
->
i_entry_count
);
p_box
->
data
.
p_stss
->
i_sample_number
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stss
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stss
->
i_entry_count
,
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
(
i
<
p_box
->
data
.
p_stss
->
i_entry_count
)
&&
(
i_read
>=
4
);
i
++
)
{
...
...
@@ -1584,10 +1584,10 @@ static int MP4_ReadBox_stsh( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_stsh
->
i_entry_count
);
p_box
->
data
.
p_stsh
->
i_shadowed_sample_number
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsh
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stsh
->
i_entry_count
,
sizeof
(
uint32_t
)
);
p_box
->
data
.
p_stsh
->
i_sync_sample_number
=
calloc
(
sizeof
(
uint32_t
),
p_box
->
data
.
p_stsh
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_stsh
->
i_entry_count
,
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
(
i
<
p_box
->
data
.
p_stss
->
i_entry_count
)
&&
(
i_read
>=
8
);
i
++
)
...
...
@@ -1620,7 +1620,7 @@ static int MP4_ReadBox_stdp( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GETVERSIONFLAGS
(
p_box
->
data
.
p_stdp
);
p_box
->
data
.
p_stdp
->
i_priority
=
calloc
(
sizeof
(
uint16_t
),
i_read
/
2
);
calloc
(
i_read
/
2
,
sizeof
(
uint16_t
)
);
for
(
i
=
0
;
i
<
i_read
/
2
;
i
++
)
{
...
...
@@ -1653,13 +1653,17 @@ static int MP4_ReadBox_padb( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_padb
->
i_sample_count
);
p_box
->
data
.
p_padb
->
i_reserved1
=
calloc
(
sizeof
(
uint16_t
),
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
);
calloc
(
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
,
sizeof
(
uint16_t
)
);
p_box
->
data
.
p_padb
->
i_pad2
=
calloc
(
sizeof
(
uint16_t
),
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
);
calloc
(
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
,
sizeof
(
uint16_t
)
);
p_box
->
data
.
p_padb
->
i_reserved2
=
calloc
(
sizeof
(
uint16_t
),
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
);
calloc
(
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
,
sizeof
(
uint16_t
)
);
p_box
->
data
.
p_padb
->
i_pad1
=
calloc
(
sizeof
(
uint16_t
),
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
);
calloc
(
(
p_box
->
data
.
p_padb
->
i_sample_count
+
1
)
/
2
,
sizeof
(
uint16_t
)
);
for
(
i
=
0
;
i
<
i_read
/
2
;
i
++
)
...
...
@@ -1700,13 +1704,13 @@ static int MP4_ReadBox_elst( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_elst
->
i_entry_count
);
p_box
->
data
.
p_elst
->
i_segment_duration
=
calloc
(
sizeof
(
uint64_t
),
p_box
->
data
.
p_elst
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_elst
->
i_entry_count
,
sizeof
(
uint64_t
)
);
p_box
->
data
.
p_elst
->
i_media_time
=
calloc
(
sizeof
(
int64_t
),
p_box
->
data
.
p_elst
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_elst
->
i_entry_count
,
sizeof
(
uint64_t
)
);
p_box
->
data
.
p_elst
->
i_media_rate_integer
=
calloc
(
sizeof
(
uint16_t
),
p_box
->
data
.
p_elst
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_elst
->
i_entry_count
,
sizeof
(
uint16_t
)
);
p_box
->
data
.
p_elst
->
i_media_rate_fraction
=
calloc
(
sizeof
(
uint16_t
),
p_box
->
data
.
p_elst
->
i_entry_count
);
calloc
(
p_box
->
data
.
p_elst
->
i_entry_count
,
sizeof
(
uint16_t
)
);
for
(
i
=
0
;
i
<
p_box
->
data
.
p_elst
->
i_entry_count
;
i
++
)
...
...
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