Commit fb9e9da0 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/oggdec: Reallocate buffer before writing into it

Fixes: out of array write
Fixes: Regression since f619e1ecReviewed-by: 's avatarLynne <dev@lynne.ee>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5d5b0bbc
...@@ -441,6 +441,12 @@ static int ogg_read_page(AVFormatContext *s, int *sid, int probing) ...@@ -441,6 +441,12 @@ static int ogg_read_page(AVFormatContext *s, int *sid, int probing)
os = ogg->streams + idx; os = ogg->streams + idx;
ret = buf_realloc(os, size);
if (ret < 0) {
av_free(readout_buf);
return ret;
}
memcpy(os->buf + os->bufpos, readout_buf, size); memcpy(os->buf + os->bufpos, readout_buf, size);
av_free(readout_buf); av_free(readout_buf);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment