From 0e020b6f2457b98ffe075ee36cf37e4430128d7f Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 3 Feb 2007 03:08:57 +0000 Subject: [PATCH] fixed bug in AVI RIFF chunk 1GB size limiting code (it was not accounting for the index buffer size which will be written afterward) which was causing the chunk to often exceed 1GB git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6773 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index 2da15b32..e09b8d43 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -826,11 +826,9 @@ static void SCR_CaptureVideo_RIFF_OverflowCheck(int framesize) cursize = SCR_CaptureVideo_RIFF_GetPosition() - cls.capturevideo.riffstackstartoffset[0]; // if this would overflow the windows limit of 1GB per RIFF chunk, we need // to close the current RIFF chunk and open another for future frames - if (8 + cursize + framesize > 1<<30) + if (8 + cursize + framesize + cls.capturevideo.riffindexbuffer.cursize + 8 > 1<<30) { SCR_CaptureVideo_RIFF_Finish(); - while (cls.capturevideo.riffstacklevel > 0) - SCR_CaptureVideo_RIFF_Pop(); // begin a new 1GB extended section of the AVI SCR_CaptureVideo_RIFF_Push("RIFF", "AVIX"); SCR_CaptureVideo_RIFF_Push("LIST", "movi"); -- 2.39.2