diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 3f161f618c..f492805d13 100644 --- a/libavformat/rdt.c +++ b/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; }