aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-10-01 16:30:15 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-10-01 16:30:15 +0000
commitc40a3a42e1e9cb47e5ac72dad2c54decb9c3a459 (patch)
treeeb44ec8156864abce81ea4fdd5fb5e2a661d99bc /libavformat/utils.c
parent95f97de146357660b58b6f8642742fc1dceeba9b (diff)
downloadffmpeg-c40a3a42e1e9cb47e5ac72dad2c54decb9c3a459.tar.gz
move free() of AVStream priv data to av_write_trailer()
Originally committed as revision 3548 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index a6a823b6c5..c1ac6d14b4 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2094,13 +2094,13 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
* @return 0 if OK. AVERROR_xxx if error. */
int av_write_trailer(AVFormatContext *s)
{
- int ret;
+ int ret, i;
for(;;){
AVPacket pkt;
ret= av_interleave_packet(s, &pkt, NULL, 1);
if(ret<0) //FIXME cleanup needed for ret<0 ?
- return ret;
+ goto fail;
if(!ret)
break;
@@ -2110,10 +2110,13 @@ int av_write_trailer(AVFormatContext *s)
av_free_packet(&pkt);
if(ret<0)
- return ret;
+ goto fail;
}
ret = s->oformat->write_trailer(s);
+fail:
+ for(i=0;i<s->nb_streams;i++)
+ av_freep(&s->streams[i]->priv_data);
av_freep(&s->priv_data);
return ret;
}