Permalink
Browse files

Handle StackOverflowErrors associated with ExifInterface

android.support.media.ExifInterface.readImageFileDirectory (ExifInterface.java:2618)
android.support.media.ExifInterface.readImageFileDirectory (ExifInterface.java:2795)
android.support.media.ExifInterface.readImageFileDirectory (ExifInterface.java:2795)
android.support.media.ExifInterface.readImageFileDirectory (ExifInterface.java:2795)
  • Loading branch information...
1 parent 2b9d4c1 commit 965814c0bfd41ca452532f52ee56b72d82a3d20f @ianhanniballake ianhanniballake committed Jan 28, 2017
@@ -71,7 +71,7 @@ protected BitmapRegionLoader openDownloadedCurrentArtwork(boolean forceReload) {
case ExifInterface.ORIENTATION_ROTATE_180: rotation = 180; break;
case ExifInterface.ORIENTATION_ROTATE_270: rotation = 270; break;
}
- } catch (IOException e) {
+ } catch (IOException|StackOverflowError e) {
Log.w(TAG, "Couldn't open EXIF interface on artwork", e);
}
return BitmapRegionLoader.newInstance(
@@ -117,7 +117,7 @@ private static int getRotation(Context context) {
case ExifInterface.ORIENTATION_ROTATE_180: rotation = 180; break;
case ExifInterface.ORIENTATION_ROTATE_270: rotation = 270; break;
}
- } catch (IOException ignored) {
+ } catch (IOException|StackOverflowError ignored) {
}
return rotation;
}
@@ -439,7 +439,7 @@ private void ensureMetadataExists(@NonNull Uri imageUri) {
}
getContentResolver().insert(GalleryContract.MetadataCache.CONTENT_URI, values);
- } catch (ParseException|IOException e) {
+ } catch (ParseException|IOException|StackOverflowError e) {
Log.w(TAG, "Couldn't read image metadata.", e);
}
}

0 comments on commit 965814c

Please sign in to comment.