<div dir="ltr"><div><div>If CreateTexture fails because of an invalid image, it doesn't leak a reference to d3drm, unlike the InitFrom* calls. So I had to either do this, or explicitly release texture->d3drm if InitFromImage fails.<br><br></div>Cheers,<br></div>Aaryaman<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 9:13 PM, Henri Verbeet <span dir="ltr"><<a href="mailto:hverbeet@gmail.com" target="_blank">hverbeet@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 11 May 2016 at 16:43, Aaryaman Vasishta <<a href="mailto:jem456.vasishta@gmail.com">jem456.vasishta@gmail.com</a>> wrote:<br>
> @@ -1152,15 +1156,21 @@ static HRESULT WINAPI d3drm3_CreateAnimationSet(IDirect3DRM3 *iface, IDirect3DRM<br>
>  static HRESULT WINAPI d3drm3_CreateTexture(IDirect3DRM3 *iface,<br>
>          D3DRMIMAGE *image, IDirect3DRMTexture3 **texture)<br>
>  {<br>
> -    struct d3drm_texture *object;<br>
>      HRESULT hr;<br>
><br>
> -    FIXME("iface %p, image %p, texture %p partial stub.\n", iface, image, texture);<br>
> +    TRACE("iface %p, image %p, texture %p.\n", iface, image, texture);<br>
><br>
> -    if (FAILED(hr = d3drm_texture_create(&object)))<br>
> +    if (!d3drm_validate_image(image))<br>
> +        return D3DRMERR_BADVALUE;<br>
</span>Why do you need the d3drm_validate_image() call? Purely for the error code?<br>
<br>
<br>
</blockquote></div><br></div>