[Libreoffice-commits] core.git: vcl/win

Armin Le Grand alg at apache.org
Mon Oct 21 06:29:30 PDT 2013


 vcl/win/source/gdi/salbmp.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 1ba10fb55a854d1eb8541a6866eb5250abf21f67
Author: Armin Le Grand <alg at apache.org>
Date:   Mon Oct 21 10:33:16 2013 +0000

    Resolves: #i123478# Secure mem freeing for BitmapBuffer class
    
    (cherry picked from commit dd1cb9aa9ea24b6c89de05e6c5deae7951b78feb)
    
    Change-Id: I7a63835d1e93f4cebc0f908d01873ea3ff91fe66

diff --git a/vcl/win/source/gdi/salbmp.cxx b/vcl/win/source/gdi/salbmp.cxx
index 1977be0..3850d84 100644
--- a/vcl/win/source/gdi/salbmp.cxx
+++ b/vcl/win/source/gdi/salbmp.cxx
@@ -354,6 +354,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap()
 
     if(pExtraRGB)
     {
+        // #i123478# shockingly, BitmapBuffer does not free the memory it is controlling
+        // in it's destructor, this *has to be done handish*. Doing it here now
+        delete[] pExtraRGB->mpBits;
         delete pExtraRGB;
     }
     else
@@ -492,6 +495,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
 
     if(pExtraA)
     {
+        // #i123478# shockingly, BitmapBuffer does not free the memory it is controlling
+        // in it's destructor, this *has to be done handish*. Doing it here now
+        delete[] pExtraA->mpBits;
         delete pExtraA;
     }
     else
@@ -506,6 +512,9 @@ Gdiplus::Bitmap* WinSalBitmap::ImplCreateGdiPlusBitmap(const WinSalBitmap& rAlph
 
     if(pExtraRGB)
     {
+        // #i123478# shockingly, BitmapBuffer does not free the memory it is controlling
+        // in it's destructor, this *has to be done handish*. Doing it here now
+        delete[] pExtraRGB->mpBits;
         delete pExtraRGB;
     }
     else


More information about the Libreoffice-commits mailing list