Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
44fc4434
Commit
44fc4434
authored
Mar 01, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix calloc usage
parent
34610e09
Changes
1
Show 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 @
44fc4434
...
...
@@ -792,9 +792,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
++
)
{
...
...
@@ -826,9 +826,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
++
)
{
...
...
@@ -1451,7 +1451,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
)
{
...
...
@@ -1486,11 +1486,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
++
)
{
...
...
@@ -1525,7 +1525,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
++
)
{
...
...
@@ -1571,7 +1571,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
++
)
{
...
...
@@ -1606,10 +1606,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
++
)
...
...
@@ -1642,7 +1642,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
++
)
{
...
...
@@ -1675,13 +1675,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
++
)
...
...
@@ -1722,13 +1726,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