From: divverent Date: Fri, 20 Apr 2012 08:20:43 +0000 (+0000) Subject: fix ReadPicture/WritePicture for sizes > 32k X-Git-Tag: xonotic-v0.7.0~144 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b2de69ccc68171e045b102528590549a7a0853e8;p=xonotic%2Fdarkplaces.git fix ReadPicture/WritePicture for sizes > 32k git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11809 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=658e9749f42ca484a096f019c9439615acb5c138 --- diff --git a/clvm_cmds.c b/clvm_cmds.c index bbb29e24..92db59dc 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -1705,14 +1705,14 @@ static void VM_CL_ReadPicture (prvm_prog_t *prog) const char *name; unsigned char *data; unsigned char *buf; - int size; + unsigned short size; int i; cachepic_t *pic; VM_SAFEPARMCOUNT(0, VM_CL_ReadPicture); name = MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)); - size = MSG_ReadShort(&cl_message); + size = (unsigned short) MSG_ReadShort(&cl_message); // check if a texture of that name exists // if yes, it is used and the data is discarded diff --git a/svvm_cmds.c b/svvm_cmds.c index aacc8568..172827d2 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -1488,7 +1488,7 @@ static void VM_SV_WritePicture(prvm_prog_t *prog) VM_SAFEPARMCOUNT(3, VM_SV_WritePicture); imgname = PRVM_G_STRING(OFS_PARM1); - size = (int) PRVM_G_FLOAT(OFS_PARM2); + size = (size_t) PRVM_G_FLOAT(OFS_PARM2); if(size > 65535) size = 65535;