mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 11:10:10 +01:00
iris: return failure if iris_resource_configure_main fail
For surface created by eglCreatePbufferSurface with attrib_list is NULL or empty, the width/height info is 0. Then in the next eglMakeCurrent call, it will try to allocate the buffer with the 0 width/height, then call surf_fill_state_s with 0 width/height, so the isl_extent3d returned by isl_get_image_alignment is (0, 0, 0), and the unreachable code will cause process crash with: "stack corruption detected (-fstack-protector)". As the width is 0, it causes row_pitch_B is 0 in isl_calc_row_pitch. And it leads to iris_resource_configure_main return fail. Update code to return fail to avoid the crash. Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17621>
This commit is contained in:
parent
001779a33d
commit
fdab8fef7a
1 changed files with 3 additions and 2 deletions
|
|
@ -1145,9 +1145,10 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
UNUSED const bool isl_surf_created_successfully =
|
const bool isl_surf_created_successfully =
|
||||||
iris_resource_configure_main(screen, res, templ, modifier, 0);
|
iris_resource_configure_main(screen, res, templ, modifier, 0);
|
||||||
assert(isl_surf_created_successfully);
|
if (!isl_surf_created_successfully)
|
||||||
|
goto fail;
|
||||||
|
|
||||||
if (!iris_resource_configure_aux(screen, res, false))
|
if (!iris_resource_configure_aux(screen, res, false))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue