@@ -1920,7 +1920,7 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
     DISPLAYLEVEL(3, "test%3i : Block-Level External Sequence Producer API: ", testNb++);
     {
         size_t const dstBufSize = ZSTD_compressBound(CNBufferSize);
-        BYTE* const dstBuf = (BYTE*)malloc(ZSTD_compressBound(dstBufSize));
+        BYTE* const dstBuf = (BYTE*)malloc(dstBufSize);
         size_t const checkBufSize = CNBufferSize;
         BYTE* const checkBuf = (BYTE*)malloc(checkBufSize);
         int enableFallback;
@@ -2359,12 +2359,12 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
     DISPLAYLEVEL(3, "test%3i : Testing external sequence producer with static CCtx: ", testNb++);
     {
         size_t const dstBufSize = ZSTD_compressBound(CNBufferSize);
-        BYTE* const dstBuf = (BYTE*)malloc(ZSTD_compressBound(dstBufSize));
+        BYTE* const dstBuf = (BYTE*)malloc(dstBufSize);
         size_t const checkBufSize = CNBufferSize;
         BYTE* const checkBuf = (BYTE*)malloc(checkBufSize);
         ZSTD_CCtx_params* params = ZSTD_createCCtxParams();
         ZSTD_CCtx* staticCCtx;
-        void* cctxBuffer;
+        void* cctxBuf;
         EMF_testCase seqProdState;
 
         CHECK_Z(ZSTD_CCtxParams_setParameter(params, ZSTD_c_validateSequences, 1));
@@ -2373,17 +2373,20 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
 
         {
             size_t const cctxSize = ZSTD_estimateCCtxSize_usingCCtxParams(params);
-            cctxBuffer = malloc(cctxSize);
-            staticCCtx = ZSTD_initStaticCCtx(cctxBuffer, cctxSize);
+            cctxBuf = malloc(cctxSize);
+            staticCCtx = ZSTD_initStaticCCtx(cctxBuf, cctxSize);
             ZSTD_CCtx_setParametersUsingCCtxParams(staticCCtx, params);
         }
 
         // Check that compression with external sequence producer succeeds when expected
         seqProdState = EMF_LOTS_OF_SEQS;
         {
+            size_t dResult;
             size_t const cResult = ZSTD_compress2(staticCCtx, dstBuf, dstBufSize, CNBuffer, CNBufferSize);
             CHECK(ZSTD_isError(cResult), "EMF: Compression error: %s", ZSTD_getErrorName(cResult));
-            CHECK_Z(ZSTD_decompress(checkBuf, checkBufSize, dstBuf, cResult));
+            dResult = ZSTD_decompress(checkBuf, checkBufSize, dstBuf, cResult);
+            CHECK(ZSTD_isError(dResult), "EMF: Decompression error: %s", ZSTD_getErrorName(dResult));
+            CHECK(dResult != CNBufferSize, "EMF: Corruption!");
             CHECK(memcmp(CNBuffer, checkBuf, CNBufferSize) != 0, "EMF: Corruption!");
         }
 
@@ -2400,7 +2403,7 @@ static int basicUnitTests(U32 seed, double compressibility, int bigTests)
 
         free(dstBuf);
         free(checkBuf);
-        free(cctxBuffer);
+        free(cctxBuf);
         ZSTD_freeCCtxParams(params);
     }
     DISPLAYLEVEL(3, "OK \n");