Fix handling of null data pointers for robust tex image calls.

BUG=angleproject:1354

Change-Id: I596ebd6d8d4d500942eeb31629113b0686933531
Reviewed-on: https://chromium-review.googlesource.com/403537
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index a45e1f2..4af40ca 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -1565,9 +1565,10 @@
         {
             context->handleError(
                 Error(GL_INVALID_OPERATION, "imageSize must be 0 if no texture data is provided."));
+            return false;
         }
 
-        if (endByte > static_cast<GLuint>(imageSize))
+        if (pixels != nullptr && endByte > static_cast<GLuint>(imageSize))
         {
             context->handleError(
                 Error(GL_INVALID_OPERATION, "imageSize must be at least %u.", endByte));