[FFmpeg-cvslog] avformat/oggparseogm: Check available data before reading global header

Michael Niedermayer git at videolan.org
Wed Apr 12 01:01:47 EEST 2017


ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Tue Apr 11 15:06:21 2017 +0200| [707d4c7fb5cee9f97fce848e8c3175c4a22ecdfb] | committer: Michael Niedermayer

avformat/oggparseogm: Check available data before reading global header

Fixes use of uninitialized data

Found-by: Thomas Guilbert <tguilbert at google.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 170d864d2c508ca8111b1d108e1e964007dab712)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=707d4c7fb5cee9f97fce848e8c3175c4a22ecdfb
---

 libavformat/oggparseogm.c | 2 ++
 1 file changed, 2 insertions(+)

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



More information about the ffmpeg-cvslog mailing list