diff --git a/sys/dev/drm/radeon/radeon_uvd.c b/sys/dev/drm/radeon/radeon_uvd.c --- a/sys/dev/drm/radeon/radeon_uvd.c +++ b/sys/dev/drm/radeon/radeon_uvd.c @@ -364,6 +364,11 @@ unsigned image_size, tmp, min_dpb_size; + if (width == 0 || height == 0) { + DRM_ERROR("Invalid UVD decoding target size!\n"); + return -EINVAL; + } + image_size = width * height; image_size += image_size / 2; image_size = ALIGN(image_size, 1024);