Browse Source

LoadSoundFile: Fix char signedness

master
Samuel Thibault 3 years ago
parent
commit
c91aa78363
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/libespeak-ng/soundicon.c

+ 3
- 3
src/libespeak-ng/soundicon.c View File

@@ -48,7 +48,7 @@ SOUND_ICON soundicon_tab[N_SOUNDICON_TAB];
static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ERROR_CONTEXT *context)
{
FILE *f;
char *p;
unsigned char *p;
int length;
char fname_temp[100];
char fname2[sizeof(path_home)+13+40];
@@ -120,7 +120,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER
fclose(f);
return create_file_error_context(context, error, fname);
}
if ((p = (char *)realloc(soundicon_tab[index].data, length)) == NULL) {
if ((p = realloc(soundicon_tab[index].data, length)) == NULL) {
fclose(f);
return ENOMEM;
}
@@ -138,7 +138,7 @@ static espeak_ng_STATUS LoadSoundFile(const char *fname, int index, espeak_ng_ER

length = p[40] | (p[41] << 8) | (p[42] << 16) | (p[43] << 24);
soundicon_tab[index].length = length / 2; // length in samples
soundicon_tab[index].data = p;
soundicon_tab[index].data = (char *) p;
return ENS_OK;
}


Loading…
Cancel
Save