summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2010-10-05 21:36:30 +0000
committerMartin Storsjö <martin@martin.st>2010-10-05 21:36:30 +0000
commit2f412421e8bb1927fcd866777dfedf223c9dfdfb (patch)
tree76778980248947dd79ee2f2d5372017c61d6839d /libavformat/mov.c
parentdc2cabd003d264644926b3b4326ed3792405f953 (diff)
movdec: Free the previous extradata
If multiple stsd atoms are parsed for the same stream, the old extradata would be leaked. Originally committed as revision 25360 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8c65f4bf73..4eea795637 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -528,6 +528,7 @@ int ff_mov_read_esds(AVFormatContext *fc, ByteIOContext *pb, MOVAtom atom)
dprintf(fc, "Specific MPEG4 header len=%d\n", len);
if((uint64_t)len > (1<<30))
return -1;
+ av_free(st->codec->extradata);
st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata)
return AVERROR(ENOMEM);