summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jin Seok Park <jinpark@google.com> 2019-05-30 09:40:57 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-05-30 09:40:57 +0000
commitf66a0737ca5838ad496c65d047ace17a152ec374 (patch)
tree559c7b60857871eb32f8433b43e05c710bb60331
parent709c46a60a430af20c5232f36a02c87ea70b616f (diff)
parent6e3113302f180c8b9ec823724835872d36b4e3ca (diff)
Merge "Catch OutOfMemoryError and log warning" into qt-dev
-rw-r--r--media/java/android/media/ExifInterface.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/media/java/android/media/ExifInterface.java b/media/java/android/media/ExifInterface.java
index 58c6be9be4c7..5645ba5d7dac 100644
--- a/media/java/android/media/ExifInterface.java
+++ b/media/java/android/media/ExifInterface.java
@@ -1794,15 +1794,13 @@ public class ExifInterface {
// Set thumbnail image offset and length
setThumbnailData(inputStream);
mIsSupportedFile = true;
- } catch (IOException e) {
+ } catch (IOException | OutOfMemoryError e) {
// Ignore exceptions in order to keep the compatibility with the old versions of
// ExifInterface.
mIsSupportedFile = false;
- if (DEBUG) {
- Log.d(TAG, "Invalid image: ExifInterface got an unsupported image format file"
- + "(ExifInterface supports JPEG and some RAW image formats only) "
- + "or a corrupted JPEG file to ExifInterface.", e);
- }
+ Log.w(TAG, "Invalid image: ExifInterface got an unsupported image format file"
+ + "(ExifInterface supports JPEG and some RAW image formats only) "
+ + "or a corrupted JPEG file to ExifInterface.", e);
} finally {
addDefaultValuesForCompatibility();