diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-18 13:49:07 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-18 15:30:34 +0200 |
commit | 9f39d3d1908dfb7764120a90cbf524e04e9ed199 (patch) | |
tree | 183d79f48c0c19ddc81a74c4c8aea86e94e8f33b | |
parent | abe6330317340c1673ab3931934f530b75695a12 (diff) | |
download | ffmpeg-9f39d3d1908dfb7764120a90cbf524e04e9ed199.tar.gz |
lavf: check that the context to avformat_open_input() is valid.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 0636742b4e..1bf5ac5dd4 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -589,6 +589,10 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma if (!s && !(s = avformat_alloc_context())) return AVERROR(ENOMEM); + if (!s->av_class){ + av_log(0, AV_LOG_ERROR, "Input context has not been properly allocated by avformat_alloc_context() and is not NULL either\n"); + return AVERROR(EINVAL); + } if (fmt) s->iformat = fmt; |