Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 773ae612 authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "ImageDecoder: Disallow empty/unsorted crop rects"

parents 23721197 beebd3ca
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1675,6 +1675,9 @@ public final class ImageDecoder implements AutoCloseable {
        if (r == null) {
            return;
        }
        if (r.width() <= 0 || r.height() <= 0) {
            throw new IllegalStateException("Subset " + r + " is empty/unsorted");
        }
        if (r.left < 0 || r.top < 0 || r.right > width || r.bottom > height) {
            throw new IllegalStateException("Subset " + r + " not contained by "
                    + "scaled image bounds: (" + width + " x " + height + ")");