i965: Fix shadowing of 'height' parameter
authorKristian Høgsberg Kristensen <krh@bitplanet.net>
Wed, 25 May 2016 16:30:26 +0000 (09:30 -0700)
committerKristian Høgsberg Kristensen <krh@bitplanet.net>
Wed, 25 May 2016 16:42:55 +0000 (09:42 -0700)
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>
src/mesa/drivers/dri/i965/intel_screen.c

index 19a66786e303b792f88f737dbe93f1392af363a0..4f14201aebf76805173d9a422d92a3464d8353fc 100644 (file)
@@ -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;
    }