Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
52ca31e6
Commit
52ca31e6
authored
Jun 20, 2008
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check memory allocations.
parent
69afa855
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
20 deletions
+36
-20
modules/demux/ps.c
modules/demux/ps.c
+2
-0
modules/demux/ps.h
modules/demux/ps.h
+34
-20
No files found.
modules/demux/ps.c
View file @
52ca31e6
...
@@ -124,6 +124,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
...
@@ -124,6 +124,7 @@ static int OpenCommon( vlc_object_t *p_this, bool b_force )
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
/* Init p_sys */
/* Init p_sys */
p_sys
->
i_mux_rate
=
0
;
p_sys
->
i_mux_rate
=
0
;
...
@@ -559,6 +560,7 @@ static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
...
@@ -559,6 +560,7 @@ static block_t *ps_pkt_read( stream_t *s, uint32_t i_code )
const
uint8_t
*
p_peek
;
const
uint8_t
*
p_peek
;
int
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
14
);
int
i_peek
=
stream_Peek
(
s
,
&
p_peek
,
14
);
int
i_size
=
ps_pkt_size
(
p_peek
,
i_peek
);
int
i_size
=
ps_pkt_size
(
p_peek
,
i_peek
);
VLC_UNUSED
(
i_code
);
if
(
i_size
<=
6
&&
p_peek
[
3
]
>
0xba
)
if
(
i_size
<=
6
&&
p_peek
[
3
]
>
0xba
)
{
{
...
...
modules/demux/ps.h
View file @
52ca31e6
...
@@ -168,9 +168,12 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id )
...
@@ -168,9 +168,12 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id )
if
(
ps_id_to_lang
(
p_psm
,
i_id
)
)
if
(
ps_id_to_lang
(
p_psm
,
i_id
)
)
{
{
tk
->
fmt
.
psz_language
=
malloc
(
4
);
tk
->
fmt
.
psz_language
=
malloc
(
4
);
if
(
tk
->
fmt
.
psz_language
)
{
memcpy
(
tk
->
fmt
.
psz_language
,
ps_id_to_lang
(
p_psm
,
i_id
),
3
);
memcpy
(
tk
->
fmt
.
psz_language
,
ps_id_to_lang
(
p_psm
,
i_id
),
3
);
tk
->
fmt
.
psz_language
[
3
]
=
0
;
tk
->
fmt
.
psz_language
[
3
]
=
0
;
}
}
}
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
@@ -534,6 +537,7 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
...
@@ -534,6 +537,7 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
while
(
i_es_base
+
4
<
i_length
)
while
(
i_es_base
+
4
<
i_length
)
{
{
ps_es_t
**
tmp_es
;
ps_es_t
es
;
ps_es_t
es
;
es
.
lang
[
0
]
=
es
.
lang
[
1
]
=
es
.
lang
[
2
]
=
0
;
es
.
lang
[
0
]
=
es
.
lang
[
1
]
=
es
.
lang
[
2
]
=
0
;
...
@@ -556,6 +560,8 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
...
@@ -556,6 +560,8 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
int
i
=
0
;
int
i
=
0
;
es
.
p_descriptor
=
malloc
(
i_info_length
);
es
.
p_descriptor
=
malloc
(
i_info_length
);
if
(
es
.
p_descriptor
)
{
memcpy
(
es
.
p_descriptor
,
p_buffer
+
i_es_base
+
4
,
i_info_length
);
memcpy
(
es
.
p_descriptor
,
p_buffer
+
i_es_base
+
4
,
i_info_length
);
while
(
i
<=
es
.
i_descriptor
-
2
)
while
(
i
<=
es
.
i_descriptor
-
2
)
...
@@ -576,12 +582,20 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
...
@@ -576,12 +582,20 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
break
;
break
;
}
}
}
}
}
p_psm
->
es
=
realloc
(
p_psm
->
es
,
sizeof
(
ps_es_t
*
)
*
(
p_psm
->
i_es
+
1
)
);
tmp_es
=
realloc
(
p_psm
->
es
,
sizeof
(
ps_es_t
*
)
*
(
p_psm
->
i_es
+
1
)
);
if
(
tmp_es
)
{
p_psm
->
es
=
tmp_es
;
p_psm
->
es
[
p_psm
->
i_es
]
=
malloc
(
sizeof
(
ps_es_t
)
);
p_psm
->
es
[
p_psm
->
i_es
]
=
malloc
(
sizeof
(
ps_es_t
)
);
if
(
p_psm
->
es
[
p_psm
->
i_es
]
)
{
*
p_psm
->
es
[
p_psm
->
i_es
++
]
=
es
;
*
p_psm
->
es
[
p_psm
->
i_es
++
]
=
es
;
i_es_base
+=
4
+
i_info_length
;
i_es_base
+=
4
+
i_info_length
;
}
}
}
}
/* TODO: CRC */
/* TODO: CRC */
...
...
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