1
From 9c2a02466053dd4762d474d89d9be9a957eaaefe Mon Sep 17 00:00:00 2001
2
From: Anton Khirnov <anton@khirnov.net>
3
Date: Tue, 12 Jul 2011 22:42:18 +0200
4
Subject: [PATCH 19/70] lavf: fix segfault in av_open_input_stream()
6
ic is NULL in case of error.
7
(cherry picked from commit 13551ad1e336573e3732fdeaf25607c47244bb80)
9
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11
libavformat/utils.c | 3 ++-
12
1 files changed, 2 insertions(+), 1 deletions(-)
14
diff --git a/libavformat/utils.c b/libavformat/utils.c
15
index 0e6b001..2cb096e 100644
16
--- a/libavformat/utils.c
17
+++ b/libavformat/utils.c
18
@@ -465,7 +465,8 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
22
- err = avformat_open_input(&ic, filename, fmt, &opts);
23
+ if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0)
25
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above