Skip to content

Commit cb94988

Browse files
Owen LinAndroid (Google) Code Review
authored andcommitted
Merge "Release the constraint on the requested version." into jb-dev
2 parents 6138296 + 3bbcbcd commit cb94988

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

graphics/java/android/graphics/BitmapRegionDecoder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ private BitmapRegionDecoder(int decoder) {
180180
*/
181181
public Bitmap decodeRegion(Rect rect, BitmapFactory.Options options) {
182182
checkRecycled("decodeRegion called on recycled region decoder");
183-
if (rect.left < 0 || rect.top < 0 || rect.right > getWidth()
184-
|| rect.bottom > getHeight())
185-
throw new IllegalArgumentException("rectangle is not inside the image");
183+
if (rect.right <= 0 || rect.bottom <= 0 || rect.left >= getWidth()
184+
|| rect.top >= getHeight())
185+
throw new IllegalArgumentException("rectangle is outside the image");
186186
return nativeDecodeRegion(mNativeBitmapRegionDecoder, rect.left, rect.top,
187187
rect.right - rect.left, rect.bottom - rect.top, options);
188188
}

0 commit comments

Comments
 (0)