summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-05-25 09:30:26 -0700
committerKristian Høgsberg Kristensen <[email protected]>2016-05-25 09:42:55 -0700
commit89bb4be91e804a5eaa996822333a0c8c5ef423ae (patch)
tree3d7833c4a6195cf8e7ff6a1a7735bbe735bbdf40 /src/mesa/drivers
parent595224f714d4a6734700d4d22165cb7fa3990238 (diff)
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 <[email protected]> Reported-by: Mathias Fröhlich <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 19a66786e30..4f14201aebf 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -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;
}