File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -71,8 +71,6 @@ bool BoxTonies::loadTonieByPath(uint8_t* path) {
71
71
cursor += readBytes;
72
72
header.audioChapterCount ++;
73
73
}
74
- free (header.audioChapters );
75
- header.audioChapters = new uint32_t [header.audioChapterCount ];
76
74
cursor = blockStart; // reread
77
75
for (uint8_t i = 0 ; i < header.audioChapterCount ; i++) {
78
76
uint32_t chapter = (uint32_t )readVariant (&buffer[cursor], bufferLen-cursor, readBytes);
@@ -120,8 +118,11 @@ void BoxTonies::clearHeader() {
120
118
// header.hash = {0}; //TODO
121
119
header.audioLength = 0 ;
122
120
header.audioId = 0 ;
123
- free (header.audioChapters );
124
121
header.audioChapterCount = 0 ;
122
+ for (uint8_t i=0 ; i<99 ; i++) {
123
+ header.audioChapters [i] = 0 ;
124
+ }
125
+
125
126
}
126
127
127
128
uint64_t BoxTonies::readVariant (uint8_t * buffer, uint16_t length, uint8_t & readBytes) {
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class BoxTonies {
16
16
uint8_t hash[20 ];
17
17
uint32_t audioLength; // length in bytes
18
18
uint32_t audioId; // id, which is the unix time stamp of file creation
19
- uint32_t * audioChapters; // Ogg page numbers for Chapters
19
+ uint32_t audioChapters[ 99 ] ; // Ogg page numbers for Chapters
20
20
uint8_t audioChapterCount;
21
21
};
22
22
You can’t perform that action at this time.
0 commit comments