Skip to content
Closed
Show file tree
Hide file tree
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
21 changes: 12 additions & 9 deletions src/java.desktop/share/native/libawt/java2d/loops/Blit.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -74,16 +74,19 @@ Java_sun_java2d_loops_Blit_Blit

srcInfo.bounds.x1 = srcx;
srcInfo.bounds.y1 = srcy;
srcInfo.bounds.x2 = UNSAFE_TO_ADD(srcx, width)
? clipInfo.bounds.x2 : (srcx + width);
srcInfo.bounds.y2 = UNSAFE_TO_ADD(srcy, height)
? clipInfo.bounds.y2 : (srcy + height);
if (UNSAFE_TO_ADD(srcx, width) ||
UNSAFE_TO_ADD(srcy, height) ||
UNSAFE_TO_ADD(dstx, width) ||
UNSAFE_TO_ADD(dsty, height)) {
return;
}

srcInfo.bounds.x2 = srcx + width;
srcInfo.bounds.y2 = srcy + height;
dstInfo.bounds.x1 = dstx;
dstInfo.bounds.y1 = dsty;
dstInfo.bounds.x2 = UNSAFE_TO_ADD(dstx, width)
? clipInfo.bounds.x2 : (dstx + width);
dstInfo.bounds.y2 = UNSAFE_TO_ADD(dsty, height)
? clipInfo.bounds.y2 : (dsty + height);
dstInfo.bounds.x2 = dstx + width;
dstInfo.bounds.y2 = dsty + height;
if (UNSAFE_TO_SUB(srcx, dstx) ||
UNSAFE_TO_SUB(srcy, dsty)) {
return;
Expand Down
60 changes: 0 additions & 60 deletions test/jdk/java/awt/Graphics/BrokenBoundsClip.java

This file was deleted.