Showing the changes to test/decoder/DecUT_ParseSyntax.cpp (1 of 12 files). Show all
Unified · Split
| @@ -65,6 +65,11 @@ int32_t InitDecoder (const bool bParseOnly, PWelsDecoderContext pCtx, SLogContex · 64 unmodified lines | ||
| 65 | 65 | if (NULL == pCtx) |
| 66 | 66 | return cmMallocMemeError; |
| 67 | 67 | |
| 68 | + if (NULL == pCtx->pMemAlign) { | |
| 69 | + pCtx->pMemAlign = new CMemoryAlign (16); | |
| 70 | + if (NULL == pCtx->pMemAlign) | |
| 71 | + return cmMallocMemeError; | |
| 72 | + } | |
| 68 | 73 | |
| 69 | 74 | return WelsInitDecoder (pCtx, bParseOnly, pLogCtx); |
| 70 | 75 | } |
| @@ -92,6 +97,10 @@ void UninitDecoder (PWelsDecoderContext pCtx) { · 21 unmodified lines | ||
| 92 | 97 | return; |
| 93 | 98 | |
| 94 | 99 | WelsEndDecoder (pCtx); |
| 100 | + if (NULL != pCtx->pMemAlign) { | |
| 101 | + delete pCtx->pMemAlign; | |
| 102 | + pCtx->pMemAlign = NULL; | |
| 103 | + } | |
| 95 | 104 | if (NULL != pCtx) { |
| 96 | 105 | free (pCtx); |
| 97 | 106 | pCtx = NULL; |
| @@ -160,6 +169,7 @@ void DecoderParseSyntaxTest::Init() { · 62 unmodified lines | ||
| 160 | 169 | // |
| 161 | 170 | m_pCtx = (PWelsDecoderContext)malloc (sizeof (SWelsDecoderContext)); |
| 162 | 171 | |
| 172 | + memset (m_pCtx, 0, sizeof (SWelsDecoderContext)); | |
| 163 | 173 | m_pWelsTrace = new welsCodecTrace(); |
| 164 | 174 | if (m_pWelsTrace != NULL) { |
| 165 | 175 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); |