summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2019-10-04 12:19:01 +0200
committer hap <happppp@users.noreply.github.com>2019-10-04 12:19:01 +0200
commit73e0eb6b4ef74a3ef81aa6d9eb64c56160ff3556 (patch)
treef17eeac009533a1dd858421bb1162fddd0d68be5 /src/lib/util
parentb51ae75c3ae7b5bb297b27a31b00de603b14220f (diff)
aviio: dont crash on buffer overflow (nw)
Diffstat (limited to 'src/lib/util')
-rw-r--r--src/lib/util/aviio.cpp3
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]); }