mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-24 18:00:48 +02:00
i965: Fix shadowing of 'height' parameter
The nested declaration of 'height' shadows a parameter and uses uninitialized memory. Fix by renaming to 'plane_height' which also makes the code clearer. This would typically break the bo size computation, but we don't use that except when mmaping, and we don't mmap YUV buffers much. Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net> Reported-by: Mathias Fröhlich <Mathias.Froehlich@gmx.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
595224f714
commit
89bb4be91e
1 changed files with 2 additions and 2 deletions
|
|
@ -732,8 +732,8 @@ intel_create_image_from_fds(__DRIscreen *screen,
|
|||
image->offsets[index] = offsets[index];
|
||||
image->strides[index] = strides[index];
|
||||
|
||||
const int height = height >> f->planes[i].height_shift;
|
||||
const int end = offsets[index] + height * strides[index];
|
||||
const int plane_height = height >> f->planes[i].height_shift;
|
||||
const int end = offsets[index] + plane_height * strides[index];
|
||||
if (size < end)
|
||||
size = end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue