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
aa65f6c6
Commit
aa65f6c6
authored
Apr 23, 2014
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat mux: prevent buffer overrun
parent
1908e010
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
modules/demux/avformat/mux.c
modules/demux/avformat/mux.c
+10
-6
No files found.
modules/demux/avformat/mux.c
View file @
aa65f6c6
...
...
@@ -81,15 +81,18 @@ int OpenMux( vlc_object_t *p_this )
{
AVOutputFormat
*
file_oformat
;
sout_mux_t
*
p_mux
=
(
sout_mux_t
*
)
p_this
;
sout_mux_sys_t
*
p_sys
;
char
*
psz_mux
;
bool
dummy
=
!
strcmp
(
p_mux
->
p_access
->
psz_access
,
"dummy"
);
if
(
dummy
&&
strlen
(
p_mux
->
p_access
->
psz_path
)
>=
sizeof
(((
AVFormatContext
*
)
NULL
)
->
filename
)
)
return
VLC_EGENERIC
;
vlc_init_avformat
(
p_this
);
config_ChainParse
(
p_mux
,
"sout-avformat-"
,
ppsz_mux_options
,
p_mux
->
p_cfg
);
/* Find the requested muxer */
psz_mux
=
var_GetNonEmpty
String
(
p_mux
,
"sout-avformat-mux"
);
char
*
psz_mux
=
var_Inherit
String
(
p_mux
,
"sout-avformat-mux"
);
if
(
psz_mux
)
{
file_oformat
=
av_guess_format
(
psz_mux
,
NULL
,
NULL
);
...
...
@@ -106,14 +109,15 @@ int OpenMux( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_mux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
sout_mux_sys_t
)
);
if
(
!
p_sys
)
sout_mux_sys_t
*
p_sys
=
malloc
(
sizeof
(
sout_mux_sys_t
)
);
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
p_mux
->
p_sys
=
p_sys
;
p_sys
->
oc
=
avformat_alloc_context
();
p_sys
->
oc
->
oformat
=
file_oformat
;
/* If we use dummy access, let avformat write output */
if
(
!
strcmp
(
p_mux
->
p_access
->
psz_access
,
"dummy"
)
)
if
(
dummy
)
strcpy
(
p_sys
->
oc
->
filename
,
p_mux
->
p_access
->
psz_path
);
/* Create I/O wrapper */
...
...
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