diff --git a/libavformat/yop.c b/libavformat/yop.c index 1185a3efc7..2d89c6e3f2 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -64,6 +64,8 @@ static int yop_read_header(AVFormatContext *s) audio_stream = avformat_new_stream(s, NULL); video_stream = avformat_new_stream(s, NULL); + if (!audio_stream || !video_stream) + return AVERROR(ENOMEM); // Extra data that will be passed to the decoder video_stream->codec->extradata_size = 8;