Commit 170d864d authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/oggparseogm: Check available data before reading global header

Fixes use of uninitialized data
Found-by: 's avatarThomas Guilbert <tguilbert@google.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cd8e6274
......@@ -108,6 +108,8 @@ ogm_header(AVFormatContext *s, int idx)
if (size > 52) {
av_assert0(AV_INPUT_BUFFER_PADDING_SIZE <= 52);
size -= 52;
if (bytestream2_get_bytes_left(&p) < size)
return AVERROR_INVALIDDATA;
ff_alloc_extradata(st->codecpar, size);
bytestream2_get_buffer(&p, st->codecpar->extradata, st->codecpar->extradata_size);
}
......
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