diff options
author | Brian Brice <bbrice@gmail.com> | 2006-11-08 18:57:02 +0000 |
---|---|---|
committer | Roman Shaposhnik <roman@shaposhnik.org> | 2006-11-08 18:57:02 +0000 |
commit | 0008afc59c240271827d8a0fc747179da905050f (patch) | |
tree | f8cc56438421ddd752afc41ef81ce566a82a5677 /libavformat/dvenc.c | |
parent | 9df5ea29f327c32f5ca47143e471a48b11c01fc9 (diff) | |
download | ffmpeg-0008afc59c240271827d8a0fc747179da905050f.tar.gz |
* fixing a memory leak in DV format.
Patch by Brian Brice bbrice at newtek dot com
Originally committed as revision 6945 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dvenc.c')
-rw-r--r-- | libavformat/dvenc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 555514428c..79cee7af69 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -279,7 +279,7 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st, DVMuxContext* dv_init_mux(AVFormatContext* s) { - DVMuxContext *c; + DVMuxContext *c = (DVMuxContext *)s->priv_data; AVStream *vst = NULL; int i; @@ -287,10 +287,6 @@ DVMuxContext* dv_init_mux(AVFormatContext* s) if (s->nb_streams > 3) return NULL; - c = av_mallocz(sizeof(DVMuxContext)); - if (!c) - return NULL; - c->n_ast = 0; c->ast[0] = c->ast[1] = NULL; @@ -345,7 +341,6 @@ DVMuxContext* dv_init_mux(AVFormatContext* s) return c; bail_out: - av_free(c); return NULL; } @@ -359,8 +354,7 @@ void dv_delete_mux(DVMuxContext *c) #ifdef CONFIG_MUXERS static int dv_write_header(AVFormatContext *s) { - s->priv_data = dv_init_mux(s); - if (!s->priv_data) { + if (!dv_init_mux(s)) { av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n" "Make sure that you supply exactly two streams:\n" " video: 25fps or 29.97fps, audio: 2ch/48Khz/PCM\n" |