decoder/ffmpeg: check avformat_open_input() return value

This commit is contained in:
Max Kellermann 2016-07-29 19:16:47 +02:00
parent 7456dccd3a
commit 7fb2f15a1a
1 changed files with 7 additions and 1 deletions

View File

@ -69,7 +69,13 @@ FfmpegOpenInput(AVIOContext *pb,
context->pb = pb;
avformat_open_input(&context, filename, fmt, nullptr);
int err = avformat_open_input(&context, filename, fmt, nullptr);
if (err < 0) {
avformat_free_context(context);
SetFfmpegError(error, err, "avformat_open_input() failed");
return nullptr;
}
return context;
}