summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b64ab0d..a67740c 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;
}