changeset 21234:f61fd8cc3128

Add a sanity check to unsafe-looking code. Does the memcpy to internal buffer here have any purpose besides enabling more potential buffer overflows?
author uau
date Sat, 25 Nov 2006 20:01:24 +0000
parents 0b17f818d393
children 7c5e2e22a37e
files sub_cc.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sub_cc.c	Sat Nov 25 19:57:31 2006 +0000
+++ b/sub_cc.c	Sat Nov 25 20:01:24 2006 +0000
@@ -284,6 +284,8 @@
 
 void subcc_process_data(unsigned char *inputdata,unsigned int len)
 {
+	if (len > CC_INPUTBUFFER_SIZE)
+		return;
 	if(!subcc_enabled) return;
 	if(!inited) subcc_init();