Magnus Ă–man's fix to prevent creation of >200K files


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3552 a1c6a512-1295-4272-9138-f99709370657
diff --git a/tools/scramble.c b/tools/scramble.c
index 716b73b..ca3cea5 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -52,6 +52,12 @@
     length = ftell(file);
     length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */
     
+    if ((length + headerlen) >= 0x32000) {
+        printf("error: max firmware size is 200KB!\n");
+        fclose(file);
+        return -1;
+    }
+    
     fseek(file,0,SEEK_SET); 
     inbuf = malloc(length);
     outbuf = malloc(length);
@@ -129,5 +135,5 @@
     free(inbuf);
     free(outbuf);
     
-    return 0;	
+    return 0;
 }