diff options
-rw-r--r-- | apps/metadata/smaf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/metadata/smaf.c b/apps/metadata/smaf.c index f7d825c96a..586802b7b5 100644 --- a/apps/metadata/smaf.c +++ b/apps/metadata/smaf.c | |||
@@ -48,8 +48,6 @@ static int support_codepages[7] = { | |||
48 | #define TAG_ARTIST (('A'<<8)|'N') | 48 | #define TAG_ARTIST (('A'<<8)|'N') |
49 | #define TAG_COMPOSER (('S'<<8)|'W') | 49 | #define TAG_COMPOSER (('S'<<8)|'W') |
50 | 50 | ||
51 | static unsigned char smafbuf[1024]; | ||
52 | |||
53 | static bool read_datachunk(unsigned char *src, int size, unsigned short tag, | 51 | static bool read_datachunk(unsigned char *src, int size, unsigned short tag, |
54 | int codepage, unsigned char *dst) | 52 | int codepage, unsigned char *dst) |
55 | { | 53 | { |
@@ -235,9 +233,11 @@ static bool get_smaf_metadata_score_track(struct mp3entry *id3, | |||
235 | 233 | ||
236 | bool get_smaf_metadata(int fd, struct mp3entry* id3) | 234 | bool get_smaf_metadata(int fd, struct mp3entry* id3) |
237 | { | 235 | { |
236 | unsigned char smafbuf[1024]; | ||
237 | |||
238 | /* Use the trackname part of the id3 structure as a temporary buffer */ | 238 | /* Use the trackname part of the id3 structure as a temporary buffer */ |
239 | unsigned char* buf = (unsigned char *)id3->path; | 239 | unsigned char* buf = (unsigned char *)id3->path; |
240 | unsigned char *endbuf = smafbuf + 1024; | 240 | unsigned char *endbuf = smafbuf + sizeof(smafbuf); |
241 | int i; | 241 | int i; |
242 | int contents_size; | 242 | int contents_size; |
243 | int codepage = ISO_8859_1; | 243 | int codepage = ISO_8859_1; |
@@ -347,8 +347,8 @@ bool get_smaf_metadata(int fd, struct mp3entry* id3) | |||
347 | if (contents_size > i) | 347 | if (contents_size > i) |
348 | lseek(fd, contents_size - i, SEEK_CUR); | 348 | lseek(fd, contents_size - i, SEEK_CUR); |
349 | 349 | ||
350 | /* assume the SMAF pcm data position is less than 1024 bytes */ | 350 | /* assume the SMAF pcm data position is near the start */ |
351 | if (read(fd, smafbuf, 1024) < 1024) | 351 | if (read(fd, smafbuf, sizeof(smafbuf)) < (ssize_t)sizeof(smafbuf)) |
352 | return false; | 352 | return false; |
353 | 353 | ||
354 | buf = smafbuf; | 354 | buf = smafbuf; |