aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-19 17:05:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-03 12:10:24 +0200
commit083e0314b5cfd917ccea6871c6584660d4543c59 (patch)
tree1e70aa30639a0a1351e166f4d1a91e175fc749c9
parentd1eb5516bb5bed1ecd2cc4483a743e0b8727fc45 (diff)
downloadffmpeg-083e0314b5cfd917ccea6871c6584660d4543c59.tar.gz
avformat/oggparsevorbis: Error out on double init of vp
Fixes: memleak Fixes: 19949/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5743636058210304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2a3bbc0086aa608cc0465dd14901178d41cfe113) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/oggparsevorbis.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index bcfd246b8d..2a91add85a 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -387,7 +387,12 @@ static int vorbis_header(AVFormatContext *s, int idx)
}
}
} else {
- int ret = fixup_vorbis_headers(s, priv, &st->codecpar->extradata);
+ int ret;
+
+ if (priv->vp)
+ return AVERROR_INVALIDDATA;
+
+ ret = fixup_vorbis_headers(s, priv, &st->codecpar->extradata);
if (ret < 0) {
st->codecpar->extradata_size = 0;
return ret;