mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-16 03:50:05 +01:00
lavf: check that the context to avformat_open_input() is valid.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -589,6 +589,10 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma
|
|||||||
|
|
||||||
if (!s && !(s = avformat_alloc_context()))
|
if (!s && !(s = avformat_alloc_context()))
|
||||||
return AVERROR(ENOMEM);
|
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)
|
if (fmt)
|
||||||
s->iformat = fmt;
|
s->iformat = fmt;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user