title: QByteArray from QFile
body: <p>I want to read a byte array into a 3D texture.</p>
  
  <pre><code>QFile file(filename);
  if(!file.open(QIODevice::ReadOnly))
  {
  
      return false;
  }
  QByteArray* data = new QByteArray(file.readAll(),  m_ImageWidth*m_ImageHeight*m_ImageCount );
  
  glGenTextures(1, m_textures);
  glActiveTexture(GL_TEXTURE0);
  glBindTexture(GL_TEXTURE_3D, m_textures[0]);
  glTexImage3D(GL_TEXTURE_3D, 0, GL_LUMINANCE, m_ImageWidth, m_ImageHeight, m_ImageCount, 
               0, GL_LUMINANCE, GL_UNSIGNED_BYTE, data);
  </code></pre>
  
  <p>Can I do this? I get access violations in my project and I want to check if they could come from here.</p>
  
  <p>It is a write violation at <code>glTexImage3D()</code></p>