]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_video_jamdecode.c
UNMERGE! ODE stuff:
[xonotic/darkplaces.git] / cl_video_jamdecode.c
index 55a4983708aa7f5740433bacb1dd268ce23efc20..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;
@@ -143,7 +143,7 @@ void jam_close(void *stream)
        Z_Free(s->prevframedata);
        Z_Free(s->videopixels);
        if (s->sndchan != -1)
-               S_StopChannel(s->sndchan, true);
+               S_StopChannel(s->sndchan, true, true);
        if (s->file)
                FS_Close(s->file);
        Z_Free(s);
@@ -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
+}