From: vortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Sat, 24 Apr 2010 18:30:51 +0000 (+0000)
Subject: fix another bug in subtitles parsing (badly parsed negative length)
X-Git-Tag: xonotic-v0.1.0preview~230^2~375
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=580fff84c75aab0ce43183763f501ec0d496575b;p=xonotic%2Fdarkplaces.git

fix another bug in subtitles parsing (badly parsed negative length)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10102 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/cl_video.c b/cl_video.c
index 3cd9860d..e7f44cac 100644
--- a/cl_video.c
+++ b/cl_video.c
@@ -139,7 +139,7 @@ static void LoadSubtitles( clvideo_t *video, const char *subtitlesfile )
 		if (numsubs > 0) // make true len for prev sub, autofix overlapping subtitles
 		{
 			if (video->subtitle_end[numsubs-1] <= 0)
-				video->subtitle_end[numsubs-1] = max(video->subtitle_start[numsubs-1], video->subtitle_start[numsubs] - video->subtitle_end[numsubs-1]);
+				video->subtitle_end[numsubs-1] = max(video->subtitle_start[numsubs-1], video->subtitle_start[numsubs] + video->subtitle_end[numsubs-1]);
 			else
 				video->subtitle_end[numsubs-1] = min(video->subtitle_start[numsubs-1] + video->subtitle_end[numsubs-1], video->subtitle_start[numsubs]);
 		}