[X2Go-Commits] [pale-moon] 31/102: Make Sourcebuffer::AppendFromInputStream handle canceled image loads.

git-admin at x2go.org git-admin at x2go.org
Mon Feb 25 23:25:46 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch upstream/28.4.0
in repository pale-moon.

commit 87bef3e99e30c47435b7dff37c098c9d99965d22
Author: wolfbeast <mcwerewolf at wolfbeast.com>
Date:   Mon Jan 21 14:02:56 2019 +0100

    Make Sourcebuffer::AppendFromInputStream handle canceled image loads.
---
 image/SourceBuffer.cpp | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/image/SourceBuffer.cpp b/image/SourceBuffer.cpp
index de0719d..de066e2 100644
--- a/image/SourceBuffer.cpp
+++ b/image/SourceBuffer.cpp
@@ -451,10 +451,18 @@ SourceBuffer::AppendFromInputStream(nsIInputStream* aInputStream,
   uint32_t bytesRead;
   nsresult rv = aInputStream->ReadSegments(AppendToSourceBuffer, this,
                                            aCount, &bytesRead);
-  if (!NS_WARN_IF(NS_FAILED(rv))) {
-    MOZ_ASSERT(bytesRead == aCount,
-               "AppendToSourceBuffer should consume everything");
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
+  }
+
+  if (bytesRead == 0) {
+    // The loading of the image has been canceled.
+    return NS_ERROR_FAILURE;
   }
+
+  MOZ_ASSERT(bytesRead == aCount,
+             "AppendToSourceBuffer should consume everything");
+
   return rv;
 }
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git


More information about the x2go-commits mailing list