[2/8] d3dx9: Check the size of a DDS file in D3DXGetImageInfoFromFileInMemory.
hverbeet at gmail.com
Sat May 12 08:22:15 CDT 2012
On 10 May 2012 20:39, Stefan Dösinger <stefandoesinger at gmx.at> wrote:
> Some test suggestions:
> *) See if the pitch_or_linearsize member is used at all
> *) Non-DWORD aligned pitches
> *) Pitches that are not pixel-size aligned
> *) pitch < width * byte_per_pixel
> *) Negative pitches / pitches > 2^31(Remember the LONG vs DWORD)
> *) A too small linear size for compressed surfaces(e.g. < block size)
If we're testing things anyway, integer overflows are always cute to
test for as well, in particular for these kinds of image handling
functions where you end up multiplying potentially untrusted width,
height and bpp. We probably don't handle that correctly at all.
More information about the wine-devel