X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=cl_video_jamdecode.c;h=a652dbc221734955ef5480e630fb9ecd1f5da783;hb=5070a71b37b3dde085b45ff86fd36c5bb274a039;hp=55a4983708aa7f5740433bacb1dd268ce23efc20;hpb=ee0a2f637d2a39ad1838c6dc1f0597cbbd135d38;p=xonotic%2Fdarkplaces.git diff --git a/cl_video_jamdecode.c b/cl_video_jamdecode.c index 55a49837..a652dbc2 100644 --- a/cl_video_jamdecode.c +++ b/cl_video_jamdecode.c @@ -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); @@ -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 +}