Fix vector access in EGL partial update tests

The vector of damage regions was being accessed even when the vector
was empty, which is invalid.

This changes the behaviour of the test, which used to invalidate the
whole framebuffer when it found no damage regions, but not invalidates
none of it. This seems like the correct behaviour.

Components: EGL
Affects: dEQP-EGL.functional.partial_update.*

Change-Id: I8c5500a85d000d16b240359de7eadc67144fb7d3
diff --git a/modules/egl/teglPartialUpdateTests.cpp b/modules/egl/teglPartialUpdateTests.cpp
index f496533..4c938ec 100644
--- a/modules/egl/teglPartialUpdateTests.cpp
+++ b/modules/egl/teglPartialUpdateTests.cpp
@@ -547,12 +547,13 @@
 			else
 			{
 				damageRegion = getDamageRegion(newFrame, 0, 0, 0, 0);
-				// Set empty damage region to avoid invalidating the framebuffer. The damage area is invalidated
-				// if the buffer age extension is not supported.
-				if (damageRegion.size() == 0)
-					damageRegion = vector<EGLint>(4, 0);
 			}
 
+			// Set empty damage region to avoid invalidating the framebuffer. The damage area is invalidated
+			// if the buffer age extension is not supported.
+			if (damageRegion.size() == 0)
+				damageRegion = vector<EGLint>(4, 0);
+
 			EGLU_CHECK_CALL(egl, setDamageRegionKHR(m_eglDisplay, m_eglSurface, &damageRegion[0], (EGLint)damageRegion.size()/4));
 		}
 		else