diff options
author | Panagiotis H.M. Issaris <takis.issaris@uhasselt.be> | 2011-12-14 17:15:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-14 17:24:49 +0100 |
commit | 9b01a8ad5ecf88aa0a8e52c2b70816e03ef59162 (patch) | |
tree | 0ed2d84125ceae520aed352d10daf14c023338b6 | |
parent | 366605ff5dc1471304e8999b8961bc9e4417fc5a (diff) | |
download | ffmpeg-9b01a8ad5ecf88aa0a8e52c2b70816e03ef59162.tar.gz |
Prevent segfault if iformat was not yet initialized.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index d84749699a..9fef5201fc 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2809,10 +2809,10 @@ void av_close_input_file(AVFormatContext *s) void avformat_close_input(AVFormatContext **ps) { AVFormatContext *s = *ps; - AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ? + AVIOContext *pb = (s->iformat && (s->iformat->flags & AVFMT_NOFILE)) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ? NULL : s->pb; flush_packet_queue(s); - if (s->iformat->read_close) + if (s->iformat && (s->iformat->read_close)) s->iformat->read_close(s); avformat_free_context(s); *ps = NULL; |