mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
codec_thread.c don't overrun audio_formats[] array
Change-Id: I58941cea061f41478d7677beb9ff42e28b2455a6
This commit is contained in:
parent
e3e72d6dba
commit
1dd531ff03
1 changed files with 7 additions and 5 deletions
|
@ -183,13 +183,15 @@ const char * get_codec_filename(int cod_spec)
|
||||||
/* Can choose decoder or encoder if one available */
|
/* Can choose decoder or encoder if one available */
|
||||||
int type = cod_spec & CODEC_TYPE_MASK;
|
int type = cod_spec & CODEC_TYPE_MASK;
|
||||||
int afmt = cod_spec & CODEC_AFMT_MASK;
|
int afmt = cod_spec & CODEC_AFMT_MASK;
|
||||||
|
int tmp_fmt = afmt;
|
||||||
if ((unsigned)afmt >= AFMT_NUM_CODECS)
|
if ((unsigned)afmt >= AFMT_NUM_CODECS)
|
||||||
|
{
|
||||||
type = AFMT_UNKNOWN | (type & CODEC_TYPE_MASK);
|
type = AFMT_UNKNOWN | (type & CODEC_TYPE_MASK);
|
||||||
|
tmp_fmt = AFMT_UNKNOWN;
|
||||||
|
}
|
||||||
fname = (type == CODEC_TYPE_ENCODER) ?
|
fname = (type == CODEC_TYPE_ENCODER) ?
|
||||||
audio_formats[afmt].codec_enc_root_fn :
|
audio_formats[tmp_fmt].codec_enc_root_fn :
|
||||||
audio_formats[afmt].codec_root_fn;
|
audio_formats[tmp_fmt].codec_root_fn;
|
||||||
|
|
||||||
logf("%s: %d - %s",
|
logf("%s: %d - %s",
|
||||||
(type == CODEC_TYPE_ENCODER) ? "Encoder" : "Decoder",
|
(type == CODEC_TYPE_ENCODER) ? "Encoder" : "Decoder",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue