summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-05 23:10:44 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-07-05 23:26:16 +0200
commite8baa8eb7f45bb5fdbfcc70ae028cd11238faa88 (patch)
treee0660ba0f1f3de8941dcc039d72b37045b780295
parentb6fe44b9db4f204ff0794401e495b73688b50c3d (diff)
downloadffmpeg-e8baa8eb7f45bb5fdbfcc70ae028cd11238faa88.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>
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index cd90480be6..c99065759b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -457,7 +457,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) {