diff options
author | Leon Scroggins <scroggo@google.com> | 2019-12-11 14:44:28 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-11 14:44:28 +0000 |
commit | 773ae61247c543f0d67b752aadb892bd4bf42c2a (patch) | |
tree | b28c05696237b02f11a8f7b43527b193fda4915c /graphics | |
parent | 237211974446ad2819fa72d3d7b14a0b3ac0a939 (diff) | |
parent | beebd3ca9bd3289f2bf76e0cd0814e34505d5ab6 (diff) |
Merge "ImageDecoder: Disallow empty/unsorted crop rects"
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/ImageDecoder.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/ImageDecoder.java b/graphics/java/android/graphics/ImageDecoder.java index 6619dba159c2..8ebac667aca3 100644 --- a/graphics/java/android/graphics/ImageDecoder.java +++ b/graphics/java/android/graphics/ImageDecoder.java @@ -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 + ")"); |