Loading media/java/android/media/ExifInterface.java +14 −0 Original line number Diff line number Diff line Loading @@ -2542,10 +2542,24 @@ public class ExifInterface { } try { if (mPosition != position) { // We don't allow seek to positions after the available bytes, // the input stream won't be able to seek back then. // However, if we hit an exception before (mPosition set to -1), // let it try the seek in hope it might recover. if (mPosition >= 0 && position >= mPosition + in.available()) { return -1; } in.seek(position); 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 (size > in.available()) { size = in.available(); } int bytesRead = in.read(buffer, offset, size); if (bytesRead >= 0) { mPosition += bytesRead; Loading Loading
media/java/android/media/ExifInterface.java +14 −0 Original line number Diff line number Diff line Loading @@ -2542,10 +2542,24 @@ public class ExifInterface { } try { if (mPosition != position) { // We don't allow seek to positions after the available bytes, // the input stream won't be able to seek back then. // However, if we hit an exception before (mPosition set to -1), // let it try the seek in hope it might recover. if (mPosition >= 0 && position >= mPosition + in.available()) { return -1; } in.seek(position); 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 (size > in.available()) { size = in.available(); } int bytesRead = in.read(buffer, offset, size); if (bytesRead >= 0) { mPosition += bytesRead; Loading