diff options
| author | Danilo Krummrich <dakr@kernel.org> | 2026-08-10 00:36:11 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-08-10 01:20:05 +0200 |
| commit | dbaafe9cc56a996931eedfe043eb34418cc9cd9b (patch) | |
| tree | 812b63d549e87c3fff744a21b75b73c8f096b5c5 /drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |
| parent | 67b1e7245bd60f54f820859b9e400136a7b6d00a (diff) | |
| parent | db2ddb87143519e20a95aa36c60b36107b736a58 (diff) | |
| download | linux-next-dbaafe9cc56a996931eedfe043eb34418cc9cd9b.tar.gz linux-next-dbaafe9cc56a996931eedfe043eb34418cc9cd9b.zip | |
Merge tag 'v7.2-rc7' into driver-core-next
We need the driver-core fixes in here as well to build on top of.
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index 480bf88def46..23383ac5323f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -655,6 +655,14 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg, unsigned int image_size, tmp, min_dpb_size, num_dpb_buffer; unsigned int min_ctx_size = ~0; + /* Reject invalid dimensions to prevent division by zero */ + if (width < 16 || height < 16) { + dev_WARN_ONCE(adev->dev, 1, + "Invalid UVD decoding dimensions (%dx%d)!\n", + width, height); + return -EINVAL; + } + image_size = width * height; image_size += image_size / 2; image_size = ALIGN(image_size, 1024); |
