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-02 19:55:09 +0200
commitd08b1cec2cb7bdc4cb09523790d734bf56d105f5 (patch)
tree8771eb09080ffc45b8d7fed6a5e8c7df09e61005
parent979800019983cd398eee78dda0f2cfd4890e933e (diff)
downloadffmpeg-d08b1cec2cb7bdc4cb09523790d734bf56d105f5.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 572e5169ca..462dd18a3d 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;