Commit ed307e26 authored by Martin Storsjö's avatar Martin Storsjö

rdt: Check the return value of avformat_open

If it failed, return NULL. This avoids trying to use an
half-initialized RDTDemuxContext.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 4b3dc857
......@@ -524,7 +524,11 @@ rdt_new_context (void)
{
PayloadContext *rdt = av_mallocz(sizeof(PayloadContext));
avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
int ret = avformat_open_input(&rdt->rmctx, "", &ff_rdt_demuxer, NULL);
if (ret < 0) {
av_free(rdt);
return NULL;
}
return rdt;
}
......
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