Loading media/java/android/media/ExifInterface.java +10 −1 Original line number Diff line number Diff line Loading @@ -2545,7 +2545,9 @@ public class ExifInterface { if (size == 0) { return 0; } if (position < 0) { // We don't allow read positions after the available bytes, // the input stream won't be able to seek back then. if (position < 0 || position >= in.available()) { return -1; } try { Loading @@ -2554,6 +2556,13 @@ public class ExifInterface { mPosition = position; } // If the read will cause us to go over the available bytes, // reduce the size so that we stay in the available range. // Otherwise the input stream may not be able to seek back. if (mPosition + size > in.available()) { size = in.available() - (int)mPosition; } int bytesRead = in.read(buffer, offset, size); if (bytesRead >= 0) { mPosition += bytesRead; Loading Loading
media/java/android/media/ExifInterface.java +10 −1 Original line number Diff line number Diff line Loading @@ -2545,7 +2545,9 @@ public class ExifInterface { if (size == 0) { return 0; } if (position < 0) { // We don't allow read positions after the available bytes, // the input stream won't be able to seek back then. if (position < 0 || position >= in.available()) { return -1; } try { Loading @@ -2554,6 +2556,13 @@ public class ExifInterface { mPosition = position; } // If the read will cause us to go over the available bytes, // reduce the size so that we stay in the available range. // Otherwise the input stream may not be able to seek back. if (mPosition + size > in.available()) { size = in.available() - (int)mPosition; } int bytesRead = in.read(buffer, offset, size); if (bytesRead >= 0) { mPosition += bytesRead; Loading