提交 86384273 编写于 作者: Z Zhenyu Wang 提交者: Dave Airlie

drm: Set cliprects to NULL when changing drawable to having 0 cliprects.

This avoids setting the cliprects pointer to a zero-sized allocation.
Signed-off-by: NZhenyu Wang <zhenyu.z.wang@intel.com>
Signed-off-by: NEric Anholt <eric@anholt.net>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 e9d21d7f
......@@ -111,7 +111,9 @@ int drm_update_drawable_info(struct drm_device *dev, void *data, struct drm_file
switch (update->type) {
case DRM_DRAWABLE_CLIPRECTS:
if (update->num != info->num_rects) {
if (update->num == 0)
rects = NULL;
else if (update->num != info->num_rects) {
rects = drm_alloc(update->num * sizeof(struct drm_clip_rect),
DRM_MEM_BUFS);
} else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册