mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
Merge "disp: msm: add array out of bounds index check"
This commit is contained in:
commit
62777b5cf4
1 changed files with 7 additions and 1 deletions
|
|
@ -375,11 +375,17 @@ struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
|
|||
goto fail;
|
||||
}
|
||||
} else {
|
||||
const struct drm_format_info *info;
|
||||
|
||||
info = drm_format_info(mode_cmd->pixel_format);
|
||||
if (!info || num_planes > ARRAY_SIZE(info->cpp))
|
||||
goto fail;
|
||||
|
||||
for (i = 0; i < num_planes; i++) {
|
||||
unsigned int width = mode_cmd->width / (i ? hsub : 1);
|
||||
unsigned int height = mode_cmd->height / (i ? vsub : 1);
|
||||
unsigned int min_size;
|
||||
unsigned int cpp;
|
||||
unsigned int cpp = 0;
|
||||
|
||||
cpp = drm_format_plane_cpp(mode_cmd->pixel_format, i);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue