[tbb-commits] [tor-browser] 127/311: Bug 1759045 - Add null check to SurfaceAllocator.acquireSurface. r=agi, a=RyanVM

gitolite role git at cupani.torproject.org
Tue Apr 26 15:28:47 UTC 2022


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

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 5fbf34c80eb5c89478f811fdb88fbbfdbb5fa1fe
Author: Jamie Nicol <jnicol at mozilla.com>
AuthorDate: Fri Mar 11 16:05:36 2022 +0000

    Bug 1759045 - Add null check to SurfaceAllocator.acquireSurface. r=agi, a=RyanVM
    
    This prevents a java NullPointerException when the
    RemoteSurfaceAllocator returns a null Surface to the local
    SurfaceAllocator instance.
    
    Differential Revision: https://phabricator.services.mozilla.com/D140801
---
 .../src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java       | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
index 6052c3226084a..2feb28310ffb9 100644
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/gfx/SurfaceAllocator.java
@@ -81,9 +81,13 @@ import org.mozilla.gecko.process.GeckoServiceChildProcess;
       }
 
       final GeckoSurface surface = sAllocator.acquireSurface(width, height, singleBufferMode);
+      if (surface == null) {
+        Log.w(LOGTAG, "Failed to acquire GeckoSurface: RemoteSurfaceAllocator returned null");
+        return null;
+      }
       sSurfaces.put(surface.getHandle(), surface);
 
-      if (surface != null && !surface.inProcess()) {
+      if (!surface.inProcess()) {
         sAllocator.configureSync(surface.initSyncSurface(width, height));
       }
       return surface;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list