Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
fd9d4315
Commit
fd9d4315
authored
Mar 10, 2008
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional checks on malloc output in data reader.
parent
1703d842
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
modules/demux/real.c
modules/demux/real.c
+24
-5
No files found.
modules/demux/real.c
View file @
fd9d4315
...
...
@@ -149,8 +149,14 @@ static int Open( vlc_object_t *p_this )
/* Fill p_demux field */
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
p_sys
==
NULL
)
{
return
VLC_ENOMEM
;
}
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_sys
->
i_data_offset
=
0
;
p_sys
->
i_track
=
0
;
p_sys
->
track
=
NULL
;
...
...
@@ -1173,14 +1179,19 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num )
case
VLC_FOURCC
(
'r'
,
'a'
,
'a'
,
'c'
):
case
VLC_FOURCC
(
'r'
,
'a'
,
'c'
,
'p'
):
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
if
(
fmt
.
i_extra
>
0
)
{
fmt
.
i_extra
--
;
p_peek
++
;
}
if
(
fmt
.
i_extra
>
0
)
{
fmt
.
p_extra
=
malloc
(
fmt
.
i_extra
);
if
(
fmt
.
p_extra
==
NULL
)
{
msg_Err
(
p_demux
,
"Error in the extra data"
);
return
VLC_EGENERIC
;
}
memcpy
(
fmt
.
p_extra
,
p_peek
,
fmt
.
i_extra
);
}
fmt
.
i_codec
=
VLC_FOURCC
(
'm'
,
'p'
,
'4'
,
'a'
);
break
;
case
VLC_FOURCC
(
's'
,
'i'
,
'p'
,
'r'
):
...
...
@@ -1191,9 +1202,17 @@ static int ReadCodecSpecificData( demux_t *p_demux, int i_len, int i_num )
fmt
.
audio
.
i_blockalign
=
i_subpacket_size
;
else
fmt
.
audio
.
i_blockalign
=
i_coded_frame_size
;
if
(
!
fmt
.
i_extra
)
break
;
fmt
.
p_extra
=
malloc
(
fmt
.
i_extra
);
memcpy
(
fmt
.
p_extra
,
p_peek
,
fmt
.
i_extra
);
if
(
fmt
.
i_extra
>
0
)
{
fmt
.
p_extra
=
malloc
(
fmt
.
i_extra
);
if
(
fmt
.
p_extra
==
NULL
)
{
msg_Err
(
p_demux
,
"Error in the extra data"
);
return
VLC_EGENERIC
;
}
memcpy
(
fmt
.
p_extra
,
p_peek
,
fmt
.
i_extra
);
}
break
;
case
VLC_FOURCC
(
'r'
,
'a'
,
'l'
,
'f'
):
...
...
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