Merge "Catch OutOfMemoryError and log warning" into qt-dev
am: f66a0737ca
Change-Id: I60846d7194e72f8362e7e1a411d0eb93b327465a
This commit is contained in:
@@ -1794,15 +1794,13 @@ public class ExifInterface {
|
|||||||
// Set thumbnail image offset and length
|
// Set thumbnail image offset and length
|
||||||
setThumbnailData(inputStream);
|
setThumbnailData(inputStream);
|
||||||
mIsSupportedFile = true;
|
mIsSupportedFile = true;
|
||||||
} catch (IOException e) {
|
} catch (IOException | OutOfMemoryError e) {
|
||||||
// Ignore exceptions in order to keep the compatibility with the old versions of
|
// Ignore exceptions in order to keep the compatibility with the old versions of
|
||||||
// ExifInterface.
|
// ExifInterface.
|
||||||
mIsSupportedFile = false;
|
mIsSupportedFile = false;
|
||||||
if (DEBUG) {
|
Log.w(TAG, "Invalid image: ExifInterface got an unsupported image format file"
|
||||||
Log.d(TAG, "Invalid image: ExifInterface got an unsupported image format file"
|
+ "(ExifInterface supports JPEG and some RAW image formats only) "
|
||||||
+ "(ExifInterface supports JPEG and some RAW image formats only) "
|
+ "or a corrupted JPEG file to ExifInterface.", e);
|
||||||
+ "or a corrupted JPEG file to ExifInterface.", e);
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
addDefaultValuesForCompatibility();
|
addDefaultValuesForCompatibility();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user