|
1 | 1 | /* |
2 | | - * Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
@@ -74,16 +74,19 @@ Java_sun_java2d_loops_Blit_Blit |
74 | 74 |
|
75 | 75 | srcInfo.bounds.x1 = srcx; |
76 | 76 | srcInfo.bounds.y1 = srcy; |
77 | | - srcInfo.bounds.x2 = UNSAFE_TO_ADD(srcx, width) |
78 | | - ? clipInfo.bounds.x2 : (srcx + width); |
79 | | - srcInfo.bounds.y2 = UNSAFE_TO_ADD(srcy, height) |
80 | | - ? clipInfo.bounds.y2 : (srcy + height); |
| 77 | + if (UNSAFE_TO_ADD(srcx, width) || |
| 78 | + UNSAFE_TO_ADD(srcy, height) || |
| 79 | + UNSAFE_TO_ADD(dstx, width) || |
| 80 | + UNSAFE_TO_ADD(dsty, height)) { |
| 81 | + return; |
| 82 | + } |
| 83 | + |
| 84 | + srcInfo.bounds.x2 = srcx + width; |
| 85 | + srcInfo.bounds.y2 = srcy + height; |
81 | 86 | dstInfo.bounds.x1 = dstx; |
82 | 87 | dstInfo.bounds.y1 = dsty; |
83 | | - dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width) |
84 | | - ? clipInfo.bounds.x2 : (dstx + width); |
85 | | - dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height) |
86 | | - ? clipInfo.bounds.y2 : (dsty + height); |
| 88 | + dstInfo.bounds.x2 = dstx + width; |
| 89 | + dstInfo.bounds.y2 = dsty + height; |
87 | 90 | if (UNSAFE_TO_SUB(srcx, dstx) || |
88 | 91 | UNSAFE_TO_SUB(srcy, dsty)) { |
89 | 92 | return; |
|
0 commit comments