EmuGL: handle NULL data in glBufferData

The data pointer argument to glBufferData can be NULL; this
[re]allocates the buffer while leaving the contents undefined.

Bug: 5833436

Change-Id: Ia1ddf62e2cd2c59d3d631e01d23d7c557ca5a52e
diff --git a/tools/emulator/opengl/host/libs/Translator/GLcommon/GLESbuffer.cpp b/tools/emulator/opengl/host/libs/Translator/GLcommon/GLESbuffer.cpp
index b055cc7..5dcdd65 100644
--- a/tools/emulator/opengl/host/libs/Translator/GLcommon/GLESbuffer.cpp
+++ b/tools/emulator/opengl/host/libs/Translator/GLcommon/GLESbuffer.cpp
@@ -25,7 +25,9 @@
     }
     m_data = new unsigned char[size];
     if(m_data) {
-        memcpy(m_data,data,size);
+        if(data) {
+            memcpy(m_data,data,size);
+        }
         m_conversionManager.clear();
         m_conversionManager.addRange(Range(0,m_size));
         return true;