]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video_jamdecode.c
fix issues with V_CalcRefdef in CSQC and stereo view
[xonotic/darkplaces.git] / cl_video_jamdecode.c
index 05650016f9c523fd4d0449993bab8bc7bcca75a4..da65ef298e96bbb42da1da2f99c20571cb149532 100644 (file)
@@ -41,7 +41,7 @@ unsigned int jam_getwidth(void *stream);
 unsigned int jam_getheight(void *stream);
 double jam_getframerate(void *stream);
 int jam_video(void *stream, void *imagedata, unsigned int Rmask, unsigned int Gmask, unsigned int Bmask, unsigned int bytesperpixel, int imagebytesperrow);
-void *jam_open(clvideo_t *video, char *filename, const char **errorstring)
+static void *jam_open(clvideo_t *video, char *filename, const char **errorstring)
 {
        unsigned char jamHead[16];
        char *wavename;
@@ -176,7 +176,7 @@ double jam_getframerate(void *stream)
 
 
 // decode JAM frame
-void jam_decodeframe(unsigned char *inbuf, unsigned char *outbuf, unsigned char *prevbuf, int outsize, int frametype)
+static void jam_decodeframe(unsigned char *inbuf, unsigned char *outbuf, unsigned char *prevbuf, int outsize, int frametype)
 {
        unsigned char *srcptr, *destptr, *prevptr;
        int bytesleft;
@@ -250,7 +250,7 @@ readframe:
                {
                        compsize = LittleLong(*(frameHead + 8)) - 16;
                        outsize = LittleLong(*(frameHead + 12));
-                       if (compsize < 0 || compsize > s->framesize || outsize < 0 || outsize > s->framesize)
+                       if (compsize > s->framesize || outsize > s->framesize)
                                s->error = JAMDECODEERROR_BAD_FRAME_HEADER;
                        else if (FS_Read(s->file, s->compressed, compsize))
                        {
@@ -352,4 +352,4 @@ readframe:
        else
                s->error = DPVSIMPLEDECODEERROR_EOF;
        return s->error;
-}
\ No newline at end of file
+}