Commit e9c00fc4 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Xiang, Haihao

Fix vaGetImage() bounds checking code.

parent 777c69c2
...@@ -1541,9 +1541,11 @@ i965_GetImage(VADriverContextP ctx, ...@@ -1541,9 +1541,11 @@ i965_GetImage(VADriverContextP ctx,
if (x < 0 || y < 0) if (x < 0 || y < 0)
return VA_STATUS_ERROR_INVALID_PARAMETER; return VA_STATUS_ERROR_INVALID_PARAMETER;
if (width > obj_surface->width || height > obj_surface->height) if (x + width > obj_surface->orig_width ||
y + height > obj_surface->orig_height)
return VA_STATUS_ERROR_INVALID_PARAMETER; return VA_STATUS_ERROR_INVALID_PARAMETER;
if (width > obj_image->image.width || height > obj_image->image.height) if (x + width > obj_image->image.width ||
y + height > obj_image->image.height)
return VA_STATUS_ERROR_INVALID_PARAMETER; return VA_STATUS_ERROR_INVALID_PARAMETER;
VAStatus va_status; VAStatus va_status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment