* MPEG Audio header decoder.
*/
-//#define DEBUG
+#include "libavutil/common.h"
+
#include "avcodec.h"
#include "mpegaudio.h"
#include "mpegaudiodata.h"
s->layer = 4 - ((header >> 17) & 3);
/* extract frequency */
sample_rate_index = (header >> 10) & 3;
+ if (sample_rate_index >= FF_ARRAY_ELEMS(avpriv_mpa_freq_tab))
+ sample_rate_index = 0;
sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25);
sample_rate_index += 3 * (s->lsf + mpeg25);
s->sample_rate_index = sample_rate_index;
break;
default:
case 3:
- avctx->codec_id = AV_CODEC_ID_MP3;
+ if (avctx->codec_id != AV_CODEC_ID_MP3ADU)
+ avctx->codec_id = AV_CODEC_ID_MP3;
if (s->lsf)
*frame_size = 576;
else