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: Martin Storsjö <martin@martin.st>
pull/2/head
Martin Storsjö 14 years ago
parent 4b3dc857e4
commit ed307e2659
  1. 6
      libavformat/rdt.c

@ -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;
}

Loading…
Cancel
Save