Commit 7fb2f15a authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: check avformat_open_input() return value

parent 7456dccd
......@@ -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;
}
......
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