foxygit / doom Log in
commit bce9b6d61d5b4c9cd8f8e29ddaaf9f4084a64cae
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Nov 8 06:57:49 2008 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Nov 8 06:57:49 2008 +0000

    Use sizeof(short) to calculate size for allocation.

    Subversion-branch: /branches/raven-branch
    Subversion-revision: 1378
---
 src/heretic/r_data.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/heretic/r_data.c b/src/heretic/r_data.c
index 994504f5..2192e8a6 100644
--- a/src/heretic/r_data.c
+++ b/src/heretic/r_data.c
@@ -410,8 +410,10 @@ void R_InitTextures(void)
                 I_Error("R_InitTextures: Missing patch in texture %s",
                         texture->name);
         }
-        texturecolumnlump[i] = Z_Malloc(texture->width * 2, PU_STATIC, 0);
-        texturecolumnofs[i] = Z_Malloc(texture->width * 2, PU_STATIC, 0);
+        texturecolumnlump[i] = Z_Malloc(texture->width * sizeof(short),
+                                        PU_STATIC, 0);
+        texturecolumnofs[i] = Z_Malloc(texture->width * sizeof(short),
+                                       PU_STATIC, 0);
         j = 1;
         while (j * 2 <= texture->width)
             j <<= 1;