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 2a3bbc0086)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2020-04-19 17:05:52 +02:00
parent 9ffcbf1db9
commit 6555a71388
1 changed files with 6 additions and 1 deletions

View File

@ -386,7 +386,12 @@ static int vorbis_header(AVFormatContext *s, int idx)
} }
} }
} else { } 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) { if (ret < 0) {
st->codecpar->extradata_size = 0; st->codecpar->extradata_size = 0;
return ret; return ret;