summaryrefslogtreecommitdiff
path: root/libavcodec/aac.c
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2008-12-21 05:08:32 +0000
committerRobert Swain <robert.swain@gmail.com>2008-12-21 05:08:32 +0000
commit99665a21f4cfe0747740b91d4e5768cffa4fe862 (patch)
treeaefb615c555aaa892d5aeb3152c7a9f7f1bc9d0f /libavcodec/aac.c
parent66c07ca96f0703134cd52f2332186c286f3dab39 (diff)
AAC: Don't write an illegal sampling_index in a PCE to the MPEG4AudioConfig
member Patch by Alex Converse (alex converse gmail com) Originally committed as revision 16249 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/aac.c')
-rw-r--r--libavcodec/aac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/aac.c b/libavcodec/aac.c
index 8fbf964d27..62d4ba5d82 100644
--- a/libavcodec/aac.c
+++ b/libavcodec/aac.c
@@ -167,15 +167,16 @@ static void decode_channel_map(enum ChannelPosition *cpe_map,
*/
static int decode_pce(AACContext * ac, enum ChannelPosition new_che_pos[4][MAX_ELEM_ID],
GetBitContext * gb) {
- int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc;
+ int num_front, num_side, num_back, num_lfe, num_assoc_data, num_cc, sampling_index;
skip_bits(gb, 2); // object_type
- ac->m4ac.sampling_index = get_bits(gb, 4);
- if(ac->m4ac.sampling_index > 11) {
+ sampling_index = get_bits(gb, 4);
+ if(sampling_index > 11) {
av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index);
return -1;
}
+ ac->m4ac.sampling_index = sampling_index;
ac->m4ac.sample_rate = ff_mpeg4audio_sample_rates[ac->m4ac.sampling_index];
num_front = get_bits(gb, 4);
num_side = get_bits(gb, 4);