1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/oggparsecelt: Do not re-allocate os->private

Fixes: double free
Fixes: clusterfuzz-testcase-minimized-5080550145785856

Found-by: ClusterFuzz
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7140761481)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-07-25 03:19:07 +02:00
parent 3fd54e4440
commit 8c05ac89d3

View File

@ -65,9 +65,14 @@ static int celt_header(AVFormatContext *s, int idx)
st->codec->channels = nb_channels;
if (sample_rate)
avpriv_set_pts_info(st, 64, 1, sample_rate);
priv->extra_headers_left = 1 + extra_headers;
av_free(os->private);
if (os->private) {
av_free(priv);
priv = os->private;
}
os->private = priv;
priv->extra_headers_left = 1 + extra_headers;
AV_WL32(st->codec->extradata + 0, overlap);
AV_WL32(st->codec->extradata + 4, version);
return 1;