From 19188818eae21fd3ff3b3c5ae35cde693b31ec28 Mon Sep 17 00:00:00 2001 From: frosch Date: Sat, 18 Mar 2017 17:14:53 +0000 Subject: (svn r27796) -Fix [FS#6545]: 32bpp-anim blitters assumed that pitch and width of the screen were equal. --- src/blitter/32bpp_anim_sse4.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/blitter/32bpp_anim_sse4.cpp') diff --git a/src/blitter/32bpp_anim_sse4.cpp b/src/blitter/32bpp_anim_sse4.cpp index 7d4b66fca..987cb0c6a 100644 --- a/src/blitter/32bpp_anim_sse4.cpp +++ b/src/blitter/32bpp_anim_sse4.cpp @@ -35,7 +35,8 @@ inline void Blitter_32bppSSE4_Anim::Draw(const Blitter::BlitterParams *bp, ZoomL { const byte * const remap = bp->remap; Colour *dst_line = (Colour *) bp->dst + bp->top * bp->pitch + bp->left; - uint16 *anim_line = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_width + bp->left; + assert(_screen.pitch == this->anim_buf_pitch); // precondition for translating 'bp->dst' into an 'anim_buf' offset below. + uint16 *anim_line = this->anim_buf + ((uint32 *)bp->dst - (uint32 *)_screen.dst_ptr) + bp->top * this->anim_buf_pitch + bp->left; int effective_width = bp->width; /* Find where to start reading in the source sprite. */ @@ -353,7 +354,7 @@ next_line: if (mode != BM_TRANSPARENT) src_mv_line += si->sprite_width; src_rgba_line = (const Colour*) ((const byte*) src_rgba_line + si->sprite_line_size); dst_line += bp->pitch; - anim_line += this->anim_buf_width; + anim_line += this->anim_buf_pitch; } } IGNORE_UNINITIALIZED_WARNING_STOP -- cgit v1.2.3-54-g00ecf