aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-04-19 17:05:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-05-26 00:45:27 +0200
commit2a3bbc0086aa608cc0465dd14901178d41cfe113 (patch)
tree21256f8af724517eb074df8e65a628be8c873535
parent6268034b5d03580f86e9ff5a1879ebd56f35db40 (diff)
downloadffmpeg-2a3bbc0086aa608cc0465dd14901178d41cfe113.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>
-rw-r--r--libavformat/oggparsevorbis.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
index 6f15204ada..246ba8fe75 100644
--- a/libavformat/oggparsevorbis.c
+++ b/libavformat/oggparsevorbis.c
@@ -385,7 +385,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;