summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2014-10-16 16:50:41 -0400
committerLeon Scroggins <scroggo@google.com>2014-10-20 22:49:35 +0000
commit91332e7ecac06ef4cd3320095689e6af21e13dc6 (patch)
tree89235dc2233c7eac92b0d0a0e0387e041480d15c
parent2fa604fc59ded63a416066a0bc66f63069cae7f3 (diff)
downloadbase-91332e7ecac06ef4cd3320095689e6af21e13dc6.tar.gz
Report that a JavaInputStreamAdaptor is at end.
This prevents a naive caller from continuing to attempt to read. BUG:17419670 BUG:17873145 Change-Id: Idd462ff9055aea42e8c7d5d58ef177f9e667385b
-rw-r--r--core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
index b64ab0d9d3ea..a67740c7f89c 100644
--- a/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
+++ b/core/jni/android/graphics/CreateJavaOutputStreamAdaptor.cpp
@@ -78,6 +78,8 @@ private:
env->ExceptionDescribe();
env->ExceptionClear();
SkDebugf("---- read threw an exception\n");
+ // Consider the stream to be at the end, since there was an error.
+ fIsAtEnd = true;
return 0;
}
@@ -92,6 +94,9 @@ private:
env->ExceptionDescribe();
env->ExceptionClear();
SkDebugf("---- read:GetByteArrayRegion threw an exception\n");
+ // The error was not with the stream itself, but consider it to be at the
+ // end, since we do not have a way to recover.
+ fIsAtEnd = true;
return 0;
}