Skip to content

Commit b0a06ed

Browse files
Misterkekurt.haenen
andauthored
Fixing crash on MP3 playback on ESP8266. (#723)
Co-authored-by: kurt.haenen <[email protected]>
1 parent cdd07c9 commit b0a06ed

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/libmad/layer3.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ static mad_fixed_t const root_table_val[7] PROGMEM = {
363363
};
364364
static inline mad_fixed_t root_table(int i)
365365
{
366-
return root_table_val[i];
366+
volatile mad_fixed_t a = root_table_val[i];
367+
return a;
367368
}
368369
/*
369370
coefficients for aliasing reduction
@@ -381,7 +382,8 @@ static mad_fixed_t const cs_val[8] PROGMEM = {
381382
};
382383
static inline mad_fixed_t cs(int i)
383384
{
384-
return cs_val[i];
385+
volatile mad_fixed_t a = cs_val[i];
386+
return a;
385387
}
386388

387389
static mad_fixed_t const ca_val[8] PROGMEM = {
@@ -392,7 +394,8 @@ static mad_fixed_t const ca_val[8] PROGMEM = {
392394
};
393395
static inline mad_fixed_t ca(int i)
394396
{
395-
return ca_val[i];
397+
volatile mad_fixed_t a = ca_val[i];
398+
return a;
396399
}
397400

398401
/*
@@ -438,7 +441,8 @@ static mad_fixed_t const window_l_val[36] PROGMEM = {
438441
};
439442
static inline mad_fixed_t window_l(int i)
440443
{
441-
return window_l_val[i];
444+
volatile mad_fixed_t a = window_l_val[i];
445+
return *(mad_fixed_t*)&a;
442446
}
443447
# endif /* ASO_IMDCT */
444448

@@ -458,7 +462,8 @@ static mad_fixed_t const window_s_val[12] PROGMEM = {
458462
};
459463
static inline mad_fixed_t window_s(int i)
460464
{
461-
return window_s_val[i];
465+
volatile mad_fixed_t a = window_s_val[i];
466+
return a;
462467
}
463468

464469
/*
@@ -479,7 +484,8 @@ static mad_fixed_t const is_table_val[7] PROGMEM = {
479484
};
480485
static inline mad_fixed_t is_table(int i)
481486
{
482-
return is_table_val[i];
487+
volatile mad_fixed_t a = is_table_val[i];
488+
return a;
483489
}
484490

485491
/*

0 commit comments

Comments
 (0)