Move glTexSubImage early out check after more of the error checks are done.
Trac #20875
Signed-off-by: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@1106 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index f1791a7..9f22716 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -5623,11 +5623,6 @@
return error(GL_INVALID_ENUM);
}
- if (width == 0 || height == 0 || pixels == NULL)
- {
- return;
- }
-
gl::Context *context = gl::getNonLostContext();
if (context)
@@ -5665,6 +5660,11 @@
return error(GL_INVALID_OPERATION);
}
+ if (width == 0 || height == 0 || pixels == NULL)
+ {
+ return;
+ }
+
if (target == GL_TEXTURE_2D)
{
gl::Texture2D *texture = context->getTexture2D();