[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - vcl/source

Michael Stahl mstahl at redhat.com
Tue Feb 4 04:49:26 PST 2014


 vcl/source/gdi/bmpfast.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 67d36215a3b846513335f69a83cb941cc5dcdc11
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jan 29 14:55:47 2014 +0100

    vcl: try to fix sizes in ImplBlendToBitmap (related: fdo#74226)
    
    Since commit 2f84b420e0428693fb2d45b68afdc9023dfc08bc,
    sw_unoapi test sw.SwAccessibleEndnoteView crashes while trying to blend
    a 1107x8 Bitmap into a 97x8 Bitmap; it's not obvious that any of the
    parameters passed in is wrong and it's odd that ImplBlendToBitmap()
    would use rSrcBuffer.mnHeight and rDstBuffer.mnWidth; presumably
    it should use both height and width of the same buffer.
    
    This backport has an additional std::min added for safety; on master we
    can try without to see if it's really needed.
    
    (cherry picked from commit 2ca79052d0fab159b017cacd3d7145d8012de850)
    
    Change-Id: I40b98ba56e703323df91f6fd7773addcfd69a402
    Reviewed-on: https://gerrit.libreoffice.org/7841
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/gdi/bmpfast.cxx b/vcl/source/gdi/bmpfast.cxx
index 0fe79ea..a6eccde 100644
--- a/vcl/source/gdi/bmpfast.cxx
+++ b/vcl/source/gdi/bmpfast.cxx
@@ -608,7 +608,8 @@ bool ImplBlendToBitmap( TrueColorPixelPtr<SRCFMT>& rSrcLine,
         nDstLinestep = -nDstLinestep;
     }
 
-    for( int y = rSrcBuffer.mnHeight; --y >= 0; )
+    assert(rDstBuffer.mnHeight <= rSrcBuffer.mnHeight); // not sure about that?
+    for (int y = std::min(rDstBuffer.mnHeight, rSrcBuffer.mnHeight); --y >= 0;)
     {
         ImplBlendLines<8>( aDstLine, rSrcLine, aMskLine, rDstBuffer.mnWidth );
         aDstLine.AddByteOffset( nDstLinestep );


More information about the Libreoffice-commits mailing list