summaryrefslogtreecommitdiff
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-29 00:28:55 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-30 02:22:50 +0100
commit2c908f22c2af0775a6ffe3466aad174a0ace00dd (patch)
tree5760685b9f0674818ba922547c1f103cadbef570 /libavformat/avidec.c
parent18b94669372d3d4b6c51e347587ea64acef9dbb8 (diff)
downloadffmpeg-2c908f22c2af0775a6ffe3466aad174a0ace00dd.tar.gz
avidec: fix leaking extradata
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index e5a292ee42..d4659657c3 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -770,6 +770,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
st->codecpar->extradata_size = esize - 10 * 4;
} else
st->codecpar->extradata_size = size - 10 * 4;
+ if (st->codecpar->extradata) {
+ av_log(s, AV_LOG_WARNING, "New extradata in strf chunk, freeing previous one.\n");
+ av_freep(&st->codecpar->extradata);
+ }
if (ff_get_extradata(s, st->codecpar, pb, st->codecpar->extradata_size) < 0)
return AVERROR(ENOMEM);
}
@@ -925,6 +929,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
st = s->streams[stream_index];
if (size<(1<<30)) {
+ if (st->codecpar->extradata) {
+ av_log(s, AV_LOG_WARNING, "New extradata in strd chunk, freeing previous one.\n");
+ av_freep(&st->codecpar->extradata);
+ }
if (ff_get_extradata(s, st->codecpar, pb, size) < 0)
return AVERROR(ENOMEM);
}