]> git.sesse.net Git - vlc/commitdiff
fix gui/skins2: ft2_bitmap.cpp write after allocated block
authorForteve Zepushisti <videolan@videolan.org>
Sat, 14 Dec 2013 19:09:59 +0000 (23:09 +0400)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 23 Jan 2014 09:33:24 +0000 (10:33 +0100)
this fixes trac #10134

Signed-off-by: Erwan Tulou <erwan10@videolan.org>
modules/gui/skins2/src/ft2_bitmap.cpp

index e7437551add64a0409a16ec8721878d4028e9a70..fed481b1c45ebad864c7b6176d0db04e9eb98ceb 100644 (file)
@@ -50,10 +50,10 @@ void FT2Bitmap::draw( const FT_Bitmap &rBitmap, int left, int top,
     uint8_t green = (color >> 8) & 0xff;
     uint8_t red = (color >> 16) & 0xff;
 
-    for( int y = top; y < top + rBitmap.rows; y++ )
+    for( int y = top; y < top + rBitmap.rows && y < m_height; y++ )
     {
         uint8_t *pData = m_pData + 4 * (m_width * y + left);
-        for( int x = left; x < left + rBitmap.width; x++ )
+        for( int x = left; x < left + rBitmap.width && x < m_width; x++ )
         {
             // The buffer in FT_Bitmap contains alpha values
             uint8_t val = *(pBuf++);