Skip to content

Commit

Permalink
avformat/oggparseogm: Check available data before reading global header
Browse files Browse the repository at this point in the history
Fixes use of uninitialized data

Found-by: Thomas Guilbert <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 11, 2017
1 parent cd8e627 commit 170d864
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libavformat/oggparseogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 170d864

Please sign in to comment.