summaryrefslogtreecommitdiff
path: root/firmware/rolo.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/rolo.c')
-rw-r--r--firmware/rolo.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 92c8cc4003..f8aad52546 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -68,8 +68,8 @@ int rolo_load(char* filename)
68 } 68 }
69 69
70 /* Read file length from header and compare to real file length */ 70 /* Read file length from header and compare to real file length */
71 length=lseek(fd,0,SEEK_END)-6; 71 length=lseek(fd,0,SEEK_END)-FIRMWARE_OFFSET_FILE_DATA;
72 lseek(fd, 0, SEEK_SET); 72 lseek(fd, FIRMWARE_OFFSET_FILE_LENGTH, SEEK_SET);
73 if(read(fd, &file_length, 4) != 4) { 73 if(read(fd, &file_length, 4) != 4) {
74 rolo_error("Error Reading File Length"); 74 rolo_error("Error Reading File Length");
75 return -1; 75 return -1;
@@ -80,12 +80,12 @@ int rolo_load(char* filename)
80 } 80 }
81 81
82 /* Read and save checksum */ 82 /* Read and save checksum */
83 lseek(fd, 4, SEEK_SET); 83 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
84 if (read(fd, &file_checksum, 2) != 2) { 84 if (read(fd, &file_checksum, 2) != 2) {
85 rolo_error("Error Reading checksum"); 85 rolo_error("Error Reading checksum");
86 return -1; 86 return -1;
87 } 87 }
88 lseek(fd, 6, SEEK_SET); 88 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
89 89
90 /* verify that file can be read and descrambled */ 90 /* verify that file can be read and descrambled */
91 if ((&mp3buf[0] + (2*length)+4) >= &mp3end) { 91 if ((&mp3buf[0] + (2*length)+4) >= &mp3end) {