diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-07-05 23:10:44 +0200 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-07-06 20:17:43 +0200 |
commit | 4e59c8ecf1433b85b539c5e89bb68cfe8b839866 (patch) | |
tree | 0b072640e01ac28aa33f0e11e76b1d70556e3363 /libavformat/utils.c | |
parent | 3950376b8baa6292f2f195dae43d7b00bcbf53e7 (diff) | |
download | ffmpeg-4e59c8ecf1433b85b539c5e89bb68cfe8b839866.tar.gz |
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=373423
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 989ddaca07..9a7d6b7a20 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -458,7 +458,7 @@ int av_open_input_stream(AVFormatContext **ic_ptr, opts = convert_format_parameters(ap); if(!ap->prealloced_context) - ic = avformat_alloc_context(); + *ic_ptr = ic = avformat_alloc_context(); else ic = *ic_ptr; if (!ic) { |