Re: [3/5] strmbase: Add validation checks when updating destination rectangle.
21 Nov
2016
21 Nov
'16
4:21 p.m.
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
3399
Age (days ago)
3399
Last active (days ago)
0 comments
1 participants
participants (1)
-
Andrew Eikum