Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 707210: fitz: fix assertion on mutool on s390x #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions source/fitz/draw-paint.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,7 @@ template_span_with_mask_1_general(byte * FZ_RESTRICT dp, const byte * FZ_RESTRIC
static fz_forceinline void
template_span_with_mask_3_general(byte * FZ_RESTRICT dp, const byte * FZ_RESTRICT sp, int a, const byte * FZ_RESTRICT mp, int w)
{
int bigendian_p = isbigendian();
do
{
int ma = *mp++;
Expand Down Expand Up @@ -1240,9 +1241,18 @@ template_span_with_mask_3_general(byte * FZ_RESTRICT dp, const byte * FZ_RESTRIC
d0 = (((d0<<8) + (s0-d0)*ma)>>8) & mask;
d1 = ((d1<<8) + (s1-d1)*ma) & ~mask;
d0 |= d1;
assert((d0>>24) >= (d0 & 0xff));
assert((d0>>24) >= ((d0>>8) & 0xff));
assert((d0>>24) >= ((d0>>16) & 0xff));
if (bigendian_p)
{
assert((d0 & 0xff) >= (d0>>24));
assert((d0 & 0xff) >= ((d0>>16) & 0xff));
assert((d0 & 0xff) >= ((d0>>8) & 0xff));
}
else
{
assert((d0>>24) >= (d0 & 0xff));
assert((d0>>24) >= ((d0>>8) & 0xff));
assert((d0>>24) >= ((d0>>16) & 0xff));
}
*(uint32_t *)dp = d0;
sp += 4;
dp += 4;
Expand Down