mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2025-12-26 14:18:36 +00:00
canvas-base: Do not attempt useless cast on stride adjustment
memmove already deal with any alignment so there's no reason to have row byte pointer cast to uint32_t. This also remove the confusing "dest" terminology used. The image is aligned in place so the image bits are used for both destination and source. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
parent
858a0bfae9
commit
f80b229e07
@ -520,12 +520,11 @@ static void canvas_fix_alignment(uint8_t *bits,
|
||||
if (stride_pixman > stride_encoded) {
|
||||
// Fix the row alignment
|
||||
int row;
|
||||
uint8_t *dest = bits;
|
||||
for (row = height - 1; row > 0; --row) {
|
||||
uint32_t *dest_aligned, *dest_misaligned;
|
||||
dest_aligned = SPICE_ALIGNED_CAST(uint32_t *,dest + stride_pixman*row);
|
||||
dest_misaligned = SPICE_UNALIGNED_CAST(uint32_t*,dest + stride_encoded*row);
|
||||
memmove(dest_aligned, dest_misaligned, stride_encoded);
|
||||
uint8_t *aligned, *misaligned;
|
||||
aligned = bits + stride_pixman*row;
|
||||
misaligned = bits + stride_encoded*row;
|
||||
memmove(aligned, misaligned, stride_encoded);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user