diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-04-11 15:06:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-04-11 23:39:21 +0200 |
commit | 707d4c7fb5cee9f97fce848e8c3175c4a22ecdfb (patch) | |
tree | ee73d507d5193f2eba95bb0cbe0e8ca03da08f1e | |
parent | c30d0ace656dfa1dbe7a6e14f72a68a36762167d (diff) | |
download | ffmpeg-707d4c7fb5cee9f97fce848e8c3175c4a22ecdfb.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>
(cherry picked from commit 170d864d2c508ca8111b1d108e1e964007dab712)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-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); } |