aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/eu/siacs/conversations/persistance/FileBackend.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java
index 7bddc55f..9d64c45f 100644
--- a/src/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/eu/siacs/conversations/persistance/FileBackend.java
@@ -135,7 +135,12 @@ public class FileBackend {
throw new ImageCopyException(
R.string.error_security_exception_during_image_copy);
} catch (OutOfMemoryError e) {
- return copyImageToPrivateStorage(message, image, sampleSize++);
+ ++sampleSize;
+ if (sampleSize<=3) {
+ return copyImageToPrivateStorage(message, image, sampleSize);
+ } else {
+ throw new ImageCopyException(R.string.error_out_of_memory);
+ }
}
}