VirtualBox

Ignore:
Timestamp:
Jan 25, 2010 2:36:17 PM (15 years ago)
Author:
vboxsync
Message:

png_write_data_fn: another (uint32_t) cast to shut up MSC, added limit+overflow assertion.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r26002 r26004  
    217217        {
    218218            uint32_t cbNew = pCtx->cbPNG + (uint32_t)cb;
     219            AssertReturnVoidStmt(cbNew > pCtx->cbPNG && cbNew <= _1G, pCtx->rc = VERR_TOO_MUCH_DATA);
    219220            cbNew = RT_ALIGN_32(cbNew, 4096) + 4096;
    220221
     
    231232
    232233        memcpy(pCtx->pu8PNG + pCtx->cbPNG, p, cb);
    233         pCtx->cbPNG += cb;
     234        pCtx->cbPNG += (uint32_t)cb;
    234235    }
    235236}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette