diff options
author | 2019-10-04 12:19:01 +0200 | |
---|---|---|
committer | 2019-10-04 12:19:01 +0200 | |
commit | 73e0eb6b4ef74a3ef81aa6d9eb64c56160ff3556 (patch) | |
tree | f17eeac009533a1dd858421bb1162fddd0d68be5 | |
parent | b51ae75c3ae7b5bb297b27a31b00de603b14220f (diff) |
aviio: dont crash on buffer overflow (nw)
-rw-r--r-- | src/lib/util/aviio.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/util/aviio.cpp b/src/lib/util/aviio.cpp index bd93cbe1847..12119073105 100644 --- a/src/lib/util/aviio.cpp +++ b/src/lib/util/aviio.cpp @@ -3264,6 +3264,9 @@ avi_file::error avi_file_impl::write_indx_chunk(avi_stream &stream, bool initial if (chunks_this_index == 0) continue; + if (master_entries >= MAX_AVI_SIZE_IN_GB / 4) + return error::WRITE_ERROR; + /* allocate memory */ std::unique_ptr<std::uint8_t []> tempbuf; try { tempbuf.reset(new std::uint8_t[24 + 8 * chunks_this_index]); } |