projects
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4b3dc85
)
rdt: Check the return value of avformat_open
author
Martin Storsjö
<martin@martin.st>
Sun, 6 Nov 2011 21:51:19 +0000
(23:51 +0200)
committer
Martin Storsjö
<martin@martin.st>
Mon, 7 Nov 2011 09:23:57 +0000
(11:23 +0200)
If it failed, return NULL. This avoids trying to use an
half-initialized RDTDemuxContext.
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rdt.c
patch
|
blob
|
blame
|
history
diff --git
a/libavformat/rdt.c
b/libavformat/rdt.c
index
3f161f6
..
f492805
100644
(file)
--- 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;
}