diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-04-11 15:06:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-04-11 21:10:25 +0200 |
commit | 170d864d2c508ca8111b1d108e1e964007dab712 (patch) | |
tree | 6a4f680507d478441fb746e3c4cb8e64da620f39 /libavformat/oggparseogm.c | |
parent | cd8e62746fedd1f593a9d441bd3a4ea137c919bb (diff) | |
download | ffmpeg-170d864d2c508ca8111b1d108e1e964007dab712.tar.gz |
avformat/oggparseogm: Check available data before reading global header
Fixes use of uninitialized data
Found-by: Thomas Guilbert <tguilbert@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/oggparseogm.c')
-rw-r--r-- | libavformat/oggparseogm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index f8e656dcb1..cdbdfd66e0 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -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); } |