mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 18:03:10 -04:00
drm/amdgpu: Reject UVD message with invalid number of h265 refs
Same change as for h264, avoids overflow later when calculating
min dpb size.
Signed-off-by: David Rosca <david.rosca@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a4b0720e4f)
Cc: stable@vger.kernel.org
This commit is contained in:
committed by
Alex Deucher
parent
cd688a3cb3
commit
9fca434208
@@ -749,6 +749,9 @@ static int amdgpu_uvd_cs_msg_decode(struct amdgpu_device *adev, uint32_t *msg,
|
||||
image_size = ALIGN(image_size, 256);
|
||||
|
||||
num_dpb_buffer = (le32_to_cpu(msg[59]) & 0xff) + 2;
|
||||
if (num_dpb_buffer > 17)
|
||||
return -EINVAL;
|
||||
|
||||
min_dpb_size = image_size * num_dpb_buffer;
|
||||
min_ctx_size = ((width + 255) / 16) * ((height + 255) / 16)
|
||||
* 16 * num_dpb_buffer + 52 * 1024;
|
||||
|
||||
Reference in New Issue
Block a user