Skip to content

Commit

Permalink
lavf: check that the context to avformat_open_input() is valid.
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 18, 2012
1 parent abe6330 commit 9f39d3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavformat/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 9f39d3d

Please sign in to comment.