Changeset 10540


Ignore:
Timestamp:
Mar 18, 2004, 12:14:02 PM (21 years ago)
Author:
sandervl
Message:

KSO: GpiCreateBitmap() sometimes read too much data, allocate more to prevent hitting the electric fence.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/user32/oslibres.cpp

    r10488 r10540  
    1 /* $Id: oslibres.cpp,v 1.38 2004-02-27 19:51:56 sandervl Exp $ */
     1/* $Id: oslibres.cpp,v 1.39 2004-03-18 11:14:02 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    458458    //      Looks like it's reading 3 bytes too much... Hopefully that's due to the
    459459    //      &pBmpMask->argbColor[2] which it assumes is 16 colors long. But no proofs.
    460     masksize = sizeof(BITMAPINFO2) + (pAndBmp->bmHeight * 2 * pAndBmp->bmWidthBytes) + (16+2)*sizeof(RGB2);
     460    //bird: Acroabat 5.1 + Printer dialog -> caused 1 byte reading too much from this buffer.
     461    //      At loss for the reason so I'm adding a safety catch of 256 extra bytes, I'm tired of this.
     462    //      (Prolem occured for bitmap: cPlanes=1 bmWidth=76 bmHeight=24 bmWidthBytes=10)
     463    masksize = sizeof(BITMAPINFO2) + (pAndBmp->bmHeight * 2 * pAndBmp->bmWidthBytes) + (16 + 2) * sizeof(RGB2) + 256;
    461464    pBmpMask = (BITMAPINFO2 *)calloc(masksize, 1);
    462465    if(pBmpMask == NULL) {
     
    475478
    476479    // The mono XOR bitmap must be first in the pointer bitmap
    477     if(pOS2XorBits || pXorBmp->bmBitsPixel == 1) 
     480    if(pOS2XorBits || pXorBmp->bmBitsPixel == 1)
    478481    {
    479         if(pXorBmp->bmBitsPixel == 1) 
     482        if(pXorBmp->bmBitsPixel == 1)
    480483        {
    481484            pOS2XorBits = (char *)calloc(pXorBmp->bmHeight, pXorBmp->bmWidthBytes);
Note: See TracChangeset for help on using the changeset viewer.