mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-18 21:30:55 +00:00
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>
This commit is contained in:
parent
4b3dc857e4
commit
ed307e2659
@ -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…
Reference in New Issue
Block a user