From 16a9c2885d9fdbc0499a776a2b29acee45e1d8a2 Mon Sep 17 00:00:00 2001 From: Daniel Kamil Kozar Date: Thu, 4 Feb 2021 00:49:50 +0100 Subject: [PATCH] Fix another non-array delete on an array Arrays should generally be deleted with delete[]. Also, this operator's behaviour (as well as the normal delete's) is well defined on null pointers (it's a no-op), so the if is totally needless. --- tsMuxer/vc1Parser.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tsMuxer/vc1Parser.h b/tsMuxer/vc1Parser.h index 9d6cb35..b5d2f3b 100644 --- a/tsMuxer/vc1Parser.h +++ b/tsMuxer/vc1Parser.h @@ -89,8 +89,7 @@ class VC1Unit } inline int vc1_unescape_buffer(uint8_t* src, int size) { - if (m_nalBuffer != 0) - delete m_nalBuffer; + delete[] m_nalBuffer; m_nalBuffer = new uint8_t[size]; int dsize = 0, i; if (size < 4)