]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix ReadPicture/WritePicture for sizes > 32k
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 20 Apr 2012 08:20:43 +0000 (08:20 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 20 Apr 2012 08:20:43 +0000 (08:20 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11809 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
svvm_cmds.c

index bbb29e248a5a34ce2662de30c95c58ffd8fe8e1a..92db59dc9cd4ce997712b76e530f462e47104686 100644 (file)
@@ -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
index aacc8568c5039bf155c3bb1323805a409e22f295..172827d202fc0ddba267b77ffaaf60f53bebd6da 100644 (file)
@@ -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;