From 203ad85c011ca7f02ad5176979375f3607ab0b33 Mon Sep 17 00:00:00 2001
From: Frank Bossen <fbossen@gmail.com>
Date: Thu, 22 Sep 2022 15:41:40 -0400
Subject: [PATCH] Properly clear SEI lists

---
 source/Lib/DecoderLib/DecLib.cpp | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/source/Lib/DecoderLib/DecLib.cpp b/source/Lib/DecoderLib/DecLib.cpp
index a90000a66..81af7b22c 100644
--- a/source/Lib/DecoderLib/DecLib.cpp
+++ b/source/Lib/DecoderLib/DecLib.cpp
@@ -498,11 +498,10 @@ DecLib::DecLib()
 
 DecLib::~DecLib()
 {
-  while (!m_prefixSEINALUs.empty())
-  {
-    delete m_prefixSEINALUs.front();
-    m_prefixSEINALUs.pop_front();
-  }
+  resetAccessUnitSeiNalus();
+  resetPictureSeiNalus();
+  resetPrefixSeiNalus();
+
   if (m_sdiSEIInFirstAU != nullptr)
   {
     delete m_sdiSEIInFirstAU;
-- 
GitLab