浏览代码

intel/blorp: Fix possible NULL pointer dereferencing

Fix incomplete check of input params in blorp_surf_convert_to_uncompressed()
which can lead to NULL pointer dereferencing.

Fixes: 5ae8043fed ("intel/blorp: Add an entrypoint for doing
bit-for-bit copies")
Fixes: f395d0abc8 ("intel/blorp: Internally expose
surf_convert_to_uncompressed")
Reviewed-by: Emil Velikov <emli.velikov@collabora.com>
Reviewed-by: Andres Gomez <agomez@igalia.com>
tags/18.0-branchpoint
Vadym Shovkoplias 7 年前
父节点
当前提交
cdb3eb7174
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/intel/blorp/blorp_blit.c

+ 2
- 2
src/intel/blorp/blorp_blit.c 查看文件

@@ -2351,7 +2351,7 @@ blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev,
*/
blorp_surf_convert_to_single_slice(isl_dev, info);

if (width || height) {
if (width && height) {
#ifndef NDEBUG
uint32_t right_edge_px = info->tile_x_sa + *x + *width;
uint32_t bottom_edge_px = info->tile_y_sa + *y + *height;
@@ -2364,7 +2364,7 @@ blorp_surf_convert_to_uncompressed(const struct isl_device *isl_dev,
*height = DIV_ROUND_UP(*height, fmtl->bh);
}

if (x || y) {
if (x && y) {
assert(*x % fmtl->bw == 0);
assert(*y % fmtl->bh == 0);
*x /= fmtl->bw;

正在加载...
取消
保存