From b1f50d70e9eae490765f599fb0cc2db2cb033760 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 23 Jan 2014 14:37:59 +0100 Subject: Catch exceptions if Exif is malformed Bug: 11650650 Change-Id: Iee8f1675850c692fe54dc619f3e969ba180e4206 --- WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'WallpaperPicker/src/com/android/photos') diff --git a/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java b/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java index cdc5cdcbd..764156de0 100644 --- a/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java +++ b/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java @@ -245,6 +245,9 @@ public class BitmapRegionTileSource implements TiledImageRenderer.TileSource { try { ei.readExif(mPath); return true; + } catch (NullPointerException e) { + Log.w("BitmapRegionTileSource", "reading exif failed", e); + return false; } catch (IOException e) { Log.w("BitmapRegionTileSource", "getting decoder failed", e); return false; @@ -311,6 +314,9 @@ public class BitmapRegionTileSource implements TiledImageRenderer.TileSource { } catch (IOException e) { Log.e("BitmapRegionTileSource", "Failed to load URI " + mUri, e); return false; + } catch (NullPointerException e) { + Log.e("BitmapRegionTileSource", "Failed to read EXIF for URI " + mUri, e); + return false; } finally { Utils.closeSilently(is); } -- cgit v1.2.3