Bug 1608235 - [ANGLE] Validate `context` before use. r=sotaro
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 23 Jan 2020 02:59:17 +0000
changeset 511289 b09849127a4f53a858ae0bfcba1343e5bd41458f
parent 511288 7cbbf288180c11737a99da55b59e88dcc6199aca
child 511290 d12980bbc425574893f31886e1e1947929a86292
push id37047
push usermalexandru@mozilla.com
push dateThu, 23 Jan 2020 09:54:33 +0000
treeherdermozilla-central@a1669b599097 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1608235
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1608235 - [ANGLE] Validate `context` before use. r=sotaro Differential Revision: https://phabricator.services.mozilla.com/D60790
gfx/angle/checkout/out/gen/angle/id/commit.h
gfx/angle/checkout/src/libANGLE/validationEGL.cpp
gfx/angle/cherry_picks.txt
--- a/gfx/angle/checkout/out/gen/angle/id/commit.h
+++ b/gfx/angle/checkout/out/gen/angle/id/commit.h
@@ -1,3 +1,3 @@
-#define ANGLE_COMMIT_HASH "5eaf76b0bfd1"
+#define ANGLE_COMMIT_HASH "3885ee272685"
 #define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2019-12-26 21:32:34 -0800"
+#define ANGLE_COMMIT_DATE "2020-01-22 18:48:23 -0800"
--- a/gfx/angle/checkout/src/libANGLE/validationEGL.cpp
+++ b/gfx/angle/checkout/src/libANGLE/validationEGL.cpp
@@ -2623,36 +2623,31 @@ Error ValidateStreamConsumerGLTextureExt
     ANGLE_TRY(ValidateDisplay(display));
 
     const DisplayExtensions &displayExtensions = display->getExtensions();
     if (!displayExtensions.streamConsumerGLTexture)
     {
         return EglBadAccess() << "Stream consumer extension not active";
     }
 
+    ANGLE_TRY(ValidateContext(display, context));
+
     // Although technically not a requirement in spec, the context needs to be checked for support
     // for external textures or future logic will cause assertations. This extension is also
     // effectively useless without external textures.
     if (!context->getExtensions().eglStreamConsumerExternal)
     {
         return EglBadAccess() << "EGL stream consumer external GL extension not enabled";
     }
 
     if (stream == EGL_NO_STREAM_KHR || !display->isValidStream(stream))
     {
         return EglBadStream() << "Invalid stream";
     }
 
-    if (!context)
-    {
-        return EglBadAccess() << "No GL context current to calling thread.";
-    }
-
-    ANGLE_TRY(ValidateContext(display, context));
-
     if (stream->getState() != EGL_STREAM_STATE_CREATED_KHR)
     {
         return EglBadState() << "Invalid stream state";
     }
 
     const gl::Caps &glCaps = context->getCaps();
 
     EGLAttrib colorBufferType = EGL_RGB_BUFFER;
--- a/gfx/angle/cherry_picks.txt
+++ b/gfx/angle/cherry_picks.txt
@@ -1,8 +1,19 @@
+commit 3885ee272685941f6dfb6cd941d550b107f033d2
+Author: Jeff Gilbert <jgilbert@mozilla.com>
+Date:   Wed Jan 22 18:42:56 2020 -0800
+
+    Validate `context` before use in ValidateStreamConsumerGLTextureExternalAttribsNV.
+    
+    Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1608235
+    
+    Bug: angleproject:4333
+    Change-Id: I957b6412f7c744e4bbaa7d8084b3c81ee58d45ca
+
 commit 5eaf76b0bfd1f149d7b03393500c6e49a393c167
 Author: Jeff Gilbert <jgilbert@mozilla.com>
 Date:   Thu Dec 26 20:58:48 2019 -0800
 
     Lost no-error context should gracefully handle GetProgramiv.
     
     Includes test that a lost no-error context doesn't crash on getProgramiv.
     Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1601703