mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
LCL: fixed range check errors
git-svn-id: trunk@15674 -
This commit is contained in:
parent
fa3bdaac2f
commit
29ea8899f8
@ -589,7 +589,7 @@ begin
|
||||
ADesc.BitOrder := riboReversedBits;
|
||||
ADesc.ByteOrder := riboMSBFirst;
|
||||
|
||||
BPR := CGImageGetBytesPerRow(ABitmap.CGImage);
|
||||
BPR := CGImageGetBytesPerRow(ABitmap.CGImage) and $FF;
|
||||
if BPR and $F = 0 then ADesc.LineEnd := rileDQWordBoundary // 128bit aligned
|
||||
else if BPR and $7 = 0 then ADesc.LineEnd := rileQWordBoundary // 64bit aligned
|
||||
else if BPR and $3 = 0 then ADesc.LineEnd := rileWordBoundary // 32bit aligned
|
||||
@ -604,7 +604,7 @@ begin
|
||||
ADesc.MaskLineEnd := rileByteBoundary;
|
||||
// ADesc.MaskShift := 0;
|
||||
|
||||
Prec := CGImageGetBitsPerComponent(ABitmap.CGImage);
|
||||
Prec := CGImageGetBitsPerComponent(ABitmap.CGImage) and $FF;
|
||||
AlphaInfo := CGImageGetAlphaInfo(ABitmap.CGImage);
|
||||
|
||||
if AlphaInfo <> kCGImageAlphaOnly
|
||||
|
@ -1346,10 +1346,10 @@ var
|
||||
if Desc.GreenShift and 7 <> 0 then Exit;
|
||||
if Desc.BlueShift and 7 <> 0 then Exit;
|
||||
|
||||
Positions := ((Desc.AlphaShift shr 3) and 3) shl 6
|
||||
Positions := (((Desc.AlphaShift shr 3) and 3) shl 6
|
||||
or ((Desc.RedShift shr 3) and 3) shl 4
|
||||
or ((Desc.GreenShift shr 3) and 3) shl 2
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
or ((Desc.BlueShift shr 3) and 3)) and $FF;
|
||||
|
||||
if Desc.ByteOrder = riboMSBFirst
|
||||
then Positions := not Positions; // reverse positions
|
||||
@ -1439,9 +1439,9 @@ var
|
||||
if Desc.GreenShift and 7 <> 0 then Exit;
|
||||
if Desc.BlueShift and 7 <> 0 then Exit;
|
||||
|
||||
Positions := ((Desc.RedShift shr 3) and 3) shl 4
|
||||
Positions := (((Desc.RedShift shr 3) and 3) shl 4
|
||||
or ((Desc.GreenShift shr 3) and 3) shl 2
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
or ((Desc.BlueShift shr 3) and 3)) and $FF;
|
||||
|
||||
if Desc.ByteOrder = riboMSBFirst
|
||||
then Positions := not Positions and %00111111; // reverse positions
|
||||
@ -1533,13 +1533,13 @@ var
|
||||
|
||||
if Desc.ByteOrder = riboMSBFirst
|
||||
then
|
||||
Positions := (2-((Desc.RedShift shr 3) and 3)) shl 4
|
||||
Positions := ((2-((Desc.RedShift shr 3) and 3)) shl 4
|
||||
or (2-((Desc.GreenShift shr 3) and 3)) shl 2
|
||||
or (2-((Desc.BlueShift shr 3) and 3))
|
||||
or (2-((Desc.BlueShift shr 3) and 3))) and $FF
|
||||
else
|
||||
Positions := ((Desc.RedShift shr 3) and 3) shl 4
|
||||
Positions := (((Desc.RedShift shr 3) and 3) shl 4
|
||||
or ((Desc.GreenShift shr 3) and 3) shl 2
|
||||
or ((Desc.BlueShift shr 3) and 3);
|
||||
or ((Desc.BlueShift shr 3) and 3)) and $FF;
|
||||
|
||||
|
||||
// the locations of R,G,B are now coded in 2 bits each: xxRRBBGG
|
||||
|
Loading…
Reference in New Issue
Block a user