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
d7830663
Commit
d7830663
authored
Nov 03, 2012
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat demux: fix invalid free
the number of streams can change after we find the stream info
parent
4f2c5774
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
modules/demux/avformat/demux.c
modules/demux/avformat/demux.c
+5
-3
No files found.
modules/demux/avformat/demux.c
View file @
d7830663
...
...
@@ -238,24 +238,26 @@ int OpenDemux( vlc_object_t *p_this )
char
*
psz_opts
=
var_InheritString
(
p_demux
,
"avformat-options"
);
AVDictionary
*
options
[
p_sys
->
ic
->
nb_streams
?
p_sys
->
ic
->
nb_streams
:
1
];
options
[
0
]
=
NULL
;
for
(
unsigned
i
=
1
;
i
<
p_sys
->
ic
->
nb_streams
;
i
++
)
unsigned
int
nb_streams
=
p_sys
->
ic
->
nb_streams
;
for
(
unsigned
i
=
1
;
i
<
nb_streams
;
i
++
)
options
[
i
]
=
NULL
;
if
(
psz_opts
&&
*
psz_opts
)
{
options
[
0
]
=
vlc_av_get_options
(
psz_opts
);
for
(
unsigned
i
=
1
;
i
<
p_sys
->
ic
->
nb_streams
;
i
++
)
{
for
(
unsigned
i
=
1
;
i
<
nb_streams
;
i
++
)
{
av_dict_copy
(
&
options
[
i
],
options
[
0
],
0
);
}
}
free
(
psz_opts
);
vlc_avcodec_lock
();
/* avformat calls avcodec behind our back!!! */
error
=
avformat_find_stream_info
(
p_sys
->
ic
,
options
);
/* FIXME: what if nb_streams change after that call? */
vlc_avcodec_unlock
();
AVDictionaryEntry
*
t
=
NULL
;
while
((
t
=
av_dict_get
(
options
[
0
],
""
,
t
,
AV_DICT_IGNORE_SUFFIX
)))
{
msg_Err
(
p_demux
,
"Unknown option
\"
%s
\"
"
,
t
->
key
);
}
av_dict_free
(
&
options
[
0
]);
for
(
unsigned
i
=
1
;
i
<
p_sys
->
ic
->
nb_streams
;
i
++
)
{
for
(
unsigned
i
=
1
;
i
<
nb_streams
;
i
++
)
{
av_dict_free
(
&
options
[
i
]);
}
#else
...
...
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