Browse Source

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 170d864d2c)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3
Michael Niedermayer 9 years ago
parent
commit
707d4c7fb5
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/oggparseogm.c

+ 2
- 0
libavformat/oggparseogm.c View File

@@ -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);
}


Loading…
Cancel
Save