This fixes case where we have 1x1 size buffer and misalignment is 0.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79616
map->stride = ALIGN(misalignment + width_bytes, 16);
- map->buffer = malloc(map->stride * map->h);
+ map->buffer = _mesa_align_malloc(map->stride * map->h, 16);
/* Offset the destination so it has the same misalignment as src. */
map->ptr = map->buffer + misalignment;
unsigned int level,
unsigned int slice)
{
- free(map->buffer);
+ _mesa_align_free(map->buffer);
map->buffer = NULL;
map->ptr = NULL;
}