Commit 4e59c8ec authored by Reimar Döffinger's avatar Reimar Döffinger

Fix av_open_input_stream with uninitialized context pointer.

Code would allocate a new context but forget to assign it
to the pointer actually passed to avformat_open_input,
potentially causing a crash.
Even if it was initialized it would cause a memleak.
This caused crashes with e.g. mpd, see also
http://bugs.gentoo.org/show_bug.cgi?id=373423Signed-off-by: 's avatarReimar Döffinger <Reimar.Doeffinger@gmx.de>
parent 3950376b
...@@ -458,7 +458,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, ...@@ -458,7 +458,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
opts = convert_format_parameters(ap); opts = convert_format_parameters(ap);
if(!ap->prealloced_context) if(!ap->prealloced_context)
ic = avformat_alloc_context(); *ic_ptr = ic = avformat_alloc_context();
else else
ic = *ic_ptr; ic = *ic_ptr;
if (!ic) { if (!ic) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment