Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91332e7e authored by Leon Scroggins III's avatar Leon Scroggins III Committed by Leon Scroggins
Browse files

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
parent 2fa604fc
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
            }