Commit 9f39d3d1 authored by Michael Niedermayer's avatar Michael Niedermayer

lavf: check that the context to avformat_open_input() is valid.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent abe63303
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment