summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/scramble.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/scramble.c b/tools/scramble.c
index 716b73b569..ca3cea5a58 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -52,6 +52,12 @@ int main (int argc, char** argv)
52 length = ftell(file); 52 length = ftell(file);
53 length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */ 53 length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */
54 54
55 if ((length + headerlen) >= 0x32000) {
56 printf("error: max firmware size is 200KB!\n");
57 fclose(file);
58 return -1;
59 }
60
55 fseek(file,0,SEEK_SET); 61 fseek(file,0,SEEK_SET);
56 inbuf = malloc(length); 62 inbuf = malloc(length);
57 outbuf = malloc(length); 63 outbuf = malloc(length);
@@ -129,5 +135,5 @@ int main (int argc, char** argv)
129 free(inbuf); 135 free(inbuf);
130 free(outbuf); 136 free(outbuf);
131 137
132 return 0; 138 return 0;
133} 139}