Mercurial > hg > dmlib
changeset 930:efbad8817b79
Some cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 25 Feb 2015 19:32:55 +0200 |
parents | e1378398be0f |
children | 2270d7f3af77 |
files | src/libgfx.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/libgfx.c Wed Feb 25 19:25:51 2015 +0200 +++ b/src/libgfx.c Wed Feb 25 19:32:55 2015 +0200 @@ -32,9 +32,11 @@ if (img == NULL) return NULL; - img->width = img->pitch = width; + img->width = width; img->height = height; - img->size = width * height * sizeof(Uint8); + img->pitch = width * sizeof(Uint8); + + img->size = img->pitch * img->height; if ((img->data = dmMalloc(img->size)) == NULL) { dmFree(img);