projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f8af93a
)
nutenc: check malloc return values.
author
Ronald S. Bultje
<rsbultje@gmail.com>
Tue, 3 May 2011 12:19:42 +0000
(08:19 -0400)
committer
Ronald S. Bultje
<rsbultje@gmail.com>
Wed, 4 May 2011 02:29:19 +0000
(22:29 -0400)
libavformat/nutenc.c
patch
|
blob
|
history
diff --git
a/libavformat/nutenc.c
b/libavformat/nutenc.c
index
4ca761a
..
85340b1
100644
(file)
--- a/
libavformat/nutenc.c
+++ b/
libavformat/nutenc.c
@@
-588,6
+588,12
@@
static int write_header(AVFormatContext *s){
nut->chapter = av_mallocz(sizeof(ChapterContext)*s->nb_chapters);
nut->time_base= av_mallocz(sizeof(AVRational )*(s->nb_streams +
s->nb_chapters));
+ if (!nut->stream || (s->nb_chapters && !nut->chapter) || !nut->time_base) {
+ av_freep(&nut->stream);
+ av_freep(&nut->chapter);
+ av_freep(&nut->time_base);
+ return AVERROR(ENOMEM);
+ }
for(i=0; i<s->nb_streams; i++){
AVStream *st= s->streams[i];