Mercurial > libavcodec.hg
comparison aac.c @ 8412:2d48043ab521 libavcodec
AAC: Don't write an illegal sampling_index in a PCE to the MPEG4AudioConfig
member
Patch by Alex Converse (alex converse gmail com)
| author | superdump |
|---|---|
| date | Sun, 21 Dec 2008 05:08:32 +0000 |
| parents | e06b2b848b74 |
| children | 6f40f7d77263 |
comparison
equal
deleted
inserted
replaced
| 8411:b749b637ecfa | 8412:2d48043ab521 |
|---|---|
| 165 * | 165 * |
| 166 * @return Returns error status. 0 - OK, !0 - error | 166 * @return Returns error status. 0 - OK, !0 - error |
| 167 */ | 167 */ |
| 168 static int decode_pce(AACContext * ac, enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], | 168 static int decode_pce(AACContext * ac, enum ChannelPosition new_che_pos[4][MAX_ELEM_ID], |
| 169 GetBitContext * gb) { | 169 GetBitContext * gb) { |
| 170 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc; | 170 int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index; |
| 171 | 171 |
| 172 skip_bits(gb, 2); // object_type | 172 skip_bits(gb, 2); // object_type |
| 173 | 173 |
| 174 ac->m4ac.sampling_index = get_bits(gb, 4); | 174 sampling_index = get_bits(gb, 4); |
| 175 if(ac->m4ac.sampling_index > 11) { | 175 if(sampling_index > 11) { |
| 176 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); | 176 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index); |
| 177 return -1; | 177 return -1; |
| 178 } | 178 } |
| 179 ac->m4ac.sampling_index = sampling_index; | |
| 179 ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index]; | 180 ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index]; |
| 180 num_front = get_bits(gb, 4); | 181 num_front = get_bits(gb, 4); |
| 181 num_side = get_bits(gb, 4); | 182 num_side = get_bits(gb, 4); |
| 182 num_back = get_bits(gb, 4); | 183 num_back = get_bits(gb, 4); |
| 183 num_lfe = get_bits(gb, 2); | 184 num_lfe = get_bits(gb, 2); |
