glTexSubImage3D crash with specific tex dimentions (510*356*50)

I create a textures with size of (51035650)
glTexStorage3D(GL_TEXTURE_3D, 1, GL_R8, 510, 356, 50);

and get an access violation exception in nvidia driver when calling
glTexSubImage3D

There is no problem with other dimentions, for example: (51235650).

Please advise,
Thanks,
Yoav

here is the code:

    int width = 510;
    int height = 356;
    int depth = 50;

    unsigned char* tex = new unsigned char[width*height*depth];
    memset(tex, 0, width*height*depth);

    unsigned texhandle = 0;
    glGenTextures(1, &texhandle);
    glBindTexture(GL_TEXTURE_3D, texhandle);
    glTexStorage3D(GL_TEXTURE_3D, 1, GL_R8, width, height, depth);
    glErr = glGetError();
    std::cout << "glGetError1=" << glErr << std::endl;

    glTexSubImage3D(GL_TEXTURE_3D, 0,
        0, 0, 0,
        width, height, depth,
        GL_RED, GL_UNSIGNED_BYTE, tex); // <=== crash. First-chance exception at 0x693aeb44 in CartoENT.exe: 0xC0000005: Access violation reading location 0x0000000025509000.
    // call stack shows: >	nvoglv64.dll!000000006937eb44() 	

    glErr = glGetError();
    std::cout << "glGetError2=" << glErr << std::endl;
    glBindTexture(GL_TEXTURE_3D, 0);

NVIDIA system information:
Operating System: Windows 7 Enterprise, 64-bit (Service Pack 1)
DirectX version: 11.0
GPU processor: GeForce GTX 780
Driver version: 355.98

Are you running with default pixel store unpack alignment of 4?
If yes, read these:
Numbers 7 and 8 in this list: [url]https://www.opengl.org/archives/resources/features/KilgardTechniques/oglpitfall/[/url]
Number 3 in this list: [url]https://www.opengl.org/wiki/Common_Mistakes[/url]