changeset 35220:349f03d4c033

Fix potential out-of-bounds write due to breaking out only of the inner loop when reaching the limit.
author reimar
date Wed, 31 Oct 2012 20:11:49 +0000
parents f46a80e9fe77
children 93337793866d
files sub/sub.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sub/sub.c	Wed Oct 31 20:05:31 2012 +0000
+++ b/sub/sub.c	Wed Oct 31 20:11:49 2012 +0000
@@ -942,6 +942,8 @@
 		    obj->params.subtitle.utbl[utblc++] = c;
 		    k++;
 		}
+		if (utblc > MAX_UCS)
+		    break;
 		obj->params.subtitle.utbl[utblc++] = ' ';
 	    }
 	    obj->params.subtitle.utbl[utblc - 1] = 0;