diff --git a/Source/capture.cpp b/Source/capture.cpp index 83cfaa08e..03f6ec38f 100644 --- a/Source/capture.cpp +++ b/Source/capture.cpp @@ -116,16 +116,15 @@ static BYTE *CaptureEnc(BYTE *src, BYTE *dst, int width) static bool CapturePix(const CelOutputBuffer &buf, std::ofstream *out) { int width = buf.w(); - BYTE *pBuffer = (BYTE *)DiabloAllocPtr(2 * width); + auto pBuffer = std::make_unique(2 * width); BYTE *pixels = buf.begin(); for (int height = buf.h(); height > 0; height--) { - const BYTE *pBufferEnd = CaptureEnc(pixels, pBuffer, width); + const BYTE *pBufferEnd = CaptureEnc(pixels, pBuffer.get(), width); pixels += buf.pitch(); - out->write(reinterpret_cast(pBuffer), pBufferEnd - pBuffer); + out->write(reinterpret_cast(pBuffer.get()), pBufferEnd - pBuffer.get()); if (out->fail()) return false; } - mem_free_dbg(pBuffer); return true; }