[3/5] strmbase: Add validation checks when updating destination rectangle.
Andrew Eikum
aeikum at codeweavers.com
Mon Nov 21 10:21:05 CST 2016
On Sun, Nov 20, 2016 at 03:33:24PM +0900, Akihiro Sagawa wrote:
> @@ -73,6 +73,17 @@ static HRESULT BaseControlVideoImpl_CheckSourceRect(BaseControlVideo *This, RECT
> return S_OK;
> }
>
> +static HRESULT BaseControlVideoImpl_CheckTargetRect(BaseControlVideo *This, RECT *pTargetRect)
> +{
> + if (pTargetRect->top >= pTargetRect->bottom ||
> + pTargetRect->left >= pTargetRect->right ||
> + (pTargetRect->bottom - pTargetRect->top) <= 0 ||
> + (pTargetRect->right - pTargetRect->left) <= 0)
> + return E_INVALIDARG;
> +
The third and fourth conditions seem redundant with the first and
second. You could use IsRectEmpty() here as well.
Andrew
More information about the wine-devel
mailing list