File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
fancycamera/src/main/java/co/fitcom/fancycamera Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,14 @@ class Camera2 extends CameraBase {
110110 @ Override
111111 public void onImageAvailable (ImageReader imageReader ) {
112112 Image image = imageReader .acquireLatestImage ();
113- Bitmap bitmap = imageToBitmap (image );
114113 try {
114+ Bitmap bitmap = imageToBitmap (image );
115115 save (bitmap );
116- } catch (IOException e ) {
117- e .printStackTrace ();
116+ } catch (Throwable t ) {
117+ // IOException and java.nio.BufferOverflowException are known possibilities,
118+ // but likely OutOfMemoryError too
119+ // Buffers and Bitmaps are crash prone
120+ t .printStackTrace ();
118121 } finally {
119122 reader = null ;
120123 Uri contentUri = Uri .fromFile (getFile ());
You can’t perform that action at this time.
0 commit comments