From 3b0017e6779e0db1a9f8fe8289a961d74c5fd561 Mon Sep 17 00:00:00 2001 From: Richard Geldreich Date: Sat, 18 Jul 2026 18:38:36 -0400 Subject: [PATCH] previewers: free rgbBuf with free() instead of delete BasisThumbProvider::GetThumbnail() allocates rgbBuf with malloc() but freed it with delete, which is a mismatched-allocator (and delete on a void*) undefined behavior. Use free() to match the allocation, as is already done for the sibling 'data' buffer. Co-Authored-By: Claude Opus 4.8 --- contrib/previewers/win/basisthumbprovider.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/previewers/win/basisthumbprovider.cpp b/contrib/previewers/win/basisthumbprovider.cpp index 292376e..1c12794 100644 --- a/contrib/previewers/win/basisthumbprovider.cpp +++ b/contrib/previewers/win/basisthumbprovider.cpp @@ -88,7 +88,7 @@ IFACEMETHODIMP BasisThumbProvider::GetThumbnail(UINT cx, HBITMAP *phbmp, WTS_ALP dprintf("Decoded!!!!"); *phbmp = rgbToBitmap(static_cast(rgbBuf), descW, descH, fileInfo.m_y_flipped); } - delete rgbBuf; + free(rgbBuf); } } }