From f6b5e5ba09cebc611176182fdcef4c5a1b426877 Mon Sep 17 00:00:00 2001 From: qqq123 <100619315+QWeiheng@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:07:08 -0500 Subject: [PATCH] add bound check in AP4_Stz2Atom::AP4_Stz2Atom --- Source/C++/Core/Ap4Stz2Atom.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/C++/Core/Ap4Stz2Atom.cpp b/Source/C++/Core/Ap4Stz2Atom.cpp index f7acb845..6fa81297 100644 --- a/Source/C++/Core/Ap4Stz2Atom.cpp +++ b/Source/C++/Core/Ap4Stz2Atom.cpp @@ -104,6 +104,7 @@ AP4_Stz2Atom::AP4_Stz2Atom(AP4_UI32 size, delete[] buffer; return; } + if (sample_count > sizeof(buffer)) return; m_SampleCount = sample_count; m_Entries.SetItemCount((AP4_Cardinal)sample_count); switch (m_FieldSize) {