swrast: Fix signed/unsigned problems with negative strides.

In swrast_map_renderbuffer negative strides lead to
render buffer map pointers that are off by 2^32.
Make sure that intermediate negative values are not
converted to an unsigned.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Mathias Fröhlich 2011-12-01 20:48:10 +01:00
parent de93347d48
commit a4c952f36f
1 changed files with 2 additions and 2 deletions

View File

@ -419,8 +419,8 @@ swrast_map_renderbuffer(struct gl_context *ctx,
stride = -stride;
}
map += y * stride;
map += x * cpp;
map += (GLsizei)y * stride;
map += (GLsizei)x * cpp;
*out_map = map;
*out_stride = stride;