summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-15 05:33:05 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2009-05-15 05:33:05 +0000
commit8be080aebb817e45bdfbb9d13a405f900ecc6b99 (patch)
treee820fc6fff77698f309a76cfe6410f6f065bf7d9 /libavformat/mxfdec.c
parentdf099252bbc85c5f3c712f0b41133b2ab29949d7 (diff)
downloadffmpeg-8be080aebb817e45bdfbb9d13a405f900ecc6b99.tar.gz
free Track and unset priv_data to avoid double free, fix memleak
Originally committed as revision 18836 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 73b0a77d2b..2986e8ecae 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -943,6 +943,10 @@ static int mxf_read_close(AVFormatContext *s)
int i;
av_freep(&mxf->packages_refs);
+
+ for (i = 0; i < s->nb_streams; i++)
+ s->streams[i]->priv_data = NULL;
+
for (i = 0; i < mxf->metadata_sets_count; i++) {
switch (mxf->metadata_sets[i]->type) {
case MultipleDescriptor:
@@ -955,9 +959,6 @@ static int mxf_read_close(AVFormatContext *s)
case MaterialPackage:
av_freep(&((MXFPackage *)mxf->metadata_sets[i])->tracks_refs);
break;
- case Track:
- mxf->metadata_sets[i] = NULL; /* will be freed later */
- break;
default:
break;
}