Ignore:
Timestamp:
May 14, 2003, 1:39:59 PM (22 years ago)
Author:
sandervl
Message:

DIB section: do not fetch more colors from a bitmap header than biClrUsed (if ..= 0); GetDIBits: save and restore negative height & log failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r9966 r10088  
    1 /* $Id: dibsect.cpp,v 1.65 2003-04-01 15:57:05 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.66 2003-05-14 11:39:59 sandervl Exp $ */
    22
    33/*
     
    141141        dibinfo.dsBitfields[0] = dibinfo.dsBitfields[1] = dibinfo.dsBitfields[2] = 0;
    142142        if(palsize) {
    143             SetDIBColorTable(0, (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));
     143            SetDIBColorTable(0, (pbmi->biClrUsed) ? pbmi->biClrUsed : (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));
    144144        }
    145145   }
     
    350350   dprintf(("DIBSection::SetDIBits (%d,%d), %d %d", pbmi->biWidth, pbmi->biHeight, pbmi->biBitCount, pbmi->biCompression));
    351351   if(palsize) {
    352         SetDIBColorTable(0, 1 << pbmi->biBitCount, (RGBQUAD *)(pbmi+1));
     352        SetDIBColorTable(0, (pbmi->biClrUsed) ? pbmi->biClrUsed : (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));
    353353   }
    354354
     
    393393  {
    394394    pOS2bmp->argbColor[i].fcOptions = 0;
    395 #ifdef DEBUG
    396395    dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) ));
    397 #endif
    398396  }
    399397  return(cEntries);
     
    420418    pOS2bmp->argbColor[i].bGreen = palentry[i].peGreen;
    421419    pOS2bmp->argbColor[i].bRed   = palentry[i].peRed;
    422 #ifdef DEBUG
    423420    dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) ));
    424 #endif
    425421  }
    426422
Note: See TracChangeset for help on using the changeset viewer.