From c6cf7f80808eee8cebec4c8417b2d99714defcac Mon Sep 17 00:00:00 2001 From: Anthony Wertz Date: Fri, 23 Mar 2018 12:03:46 -0400 Subject: [PATCH] Sets a higher limit on videoio's AVI container's maximum chunk size, and adds an explanation of the assertion. Closes #11126 --- modules/videoio/src/container_avi.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/videoio/src/container_avi.cpp b/modules/videoio/src/container_avi.cpp index 5d9e19e09b..584751cf75 100644 --- a/modules/videoio/src/container_avi.cpp +++ b/modules/videoio/src/container_avi.cpp @@ -511,7 +511,12 @@ std::vector AVIReadContainer::readFrame(frame_iterator it) RiffChunk chunk; *(m_file_stream) >> chunk; - CV_Assert(chunk.m_size <= 0xFFFF); + + // Assertion added to prevent complaints from static analysis tools + // as the chunk size is read from a file then used to allocate + // memory. 64MB was chosen arbitrarily as an upper bound but it may + // be useful to make it configurable. + CV_Assert(chunk.m_size <= 67108864); std::vector result;