diff options
| author | Ray <[email protected]> | 2017-02-01 00:28:28 +0100 |
|---|---|---|
| committer | Ray <[email protected]> | 2017-02-01 00:28:28 +0100 |
| commit | a08117155da1a0a439239ad8801a58b85f528014 (patch) | |
| tree | eaa4638170df055d86a4e7615d96ec09ff2b2200 /src/rlgl.c | |
| parent | 495108a2e9a911c88c090f2ddd82391130701031 (diff) | |
| download | raylib-a08117155da1a0a439239ad8801a58b85f528014.tar.gz raylib-a08117155da1a0a439239ad8801a58b85f528014.zip | |
Init memory for screenshot to zero
Diffstat (limited to 'src/rlgl.c')
| -rw-r--r-- | src/rlgl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2198,7 +2198,7 @@ void rlglUnloadMesh(Mesh *mesh) // Read screen pixel data (color buffer) unsigned char *rlglReadScreenPixels(int width, int height) { - unsigned char *screenData = (unsigned char *)malloc(width*height*sizeof(unsigned char)*4); + unsigned char *screenData = (unsigned char *)calloc(width*height*4, sizeof(unsigned char)); // NOTE: glReadPixels returns image flipped vertically -> (0,0) is the bottom left corner of the framebuffer glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, screenData); |
