On Sun, May 8, 2016 at 9:39 PM, Stefan Dösinger <stefandoesinger@gmx.at> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256



Am 2016-05-08 um 11:31 schrieb Aaryaman Vasishta:
> +    hr = IDirect3DRMTexture2_InitFromImage(texture2, &initimg);
> +    ok(hr == D3DRMERR_BADOBJECT, "Expected hr == D3DRMERR_BADOBJECT, got %x.\n", hr);
> +    /* Release leaked reference to d3drm1 */
> +    IDirect3DRM_Release(d3drm1);
I think it's a good idea to explicitly test the increased refcount
after this failing call.
The refcount tests which happen following the leak do (indirectly) test the increased refcount. If I hadn't released d3drm1 here, the following refcount tests would fail.

> +    if (!image
> +            || !image->rgb
> +            || !image->red_mask
> +            || !image->green_mask
> +            || !image->blue_mask
> +            || !image->buffer1)
> +    {
> +        return FALSE;
> +    }
I guess that there's some way to pass palletized images, e.g. by
setting rgb = 0, palette_size != 0 and palette != NULL. This shouldn't
be part of this patch though and I am fine with this code as it is.
Agreed, that also needs to be tested. I'll add that test in this patch and rework this function.

Cheers,
Aaryaman