comparison aac.c @ 8789:b2a991a936e1 libavcodec

Check sampling index validity for AAC decoding Patch by Jai Menon ( jmenon86 gmail com )
author superdump
date Tue, 10 Feb 2009 13:47:50 +0000
parents e9d9d946f213
children 464c36527303
comparison
equal deleted inserted replaced
8788:5e9e735cd793 8789:b2a991a936e1
1553 if (show_bits(&gb, 12) == 0xfff) { 1553 if (show_bits(&gb, 12) == 0xfff) {
1554 if ((err = parse_adts_frame_header(ac, &gb)) < 0) { 1554 if ((err = parse_adts_frame_header(ac, &gb)) < 0) {
1555 av_log(avccontext, AV_LOG_ERROR, "Error decoding AAC frame header.\n"); 1555 av_log(avccontext, AV_LOG_ERROR, "Error decoding AAC frame header.\n");
1556 return -1; 1556 return -1;
1557 } 1557 }
1558 if (ac->m4ac.sampling_index > 11) {
1559 av_log(ac->avccontext, AV_LOG_ERROR, "invalid sampling rate index %d\n", ac->m4ac.sampling_index);
1560 return -1;
1561 }
1558 } 1562 }
1559 1563
1560 // parse 1564 // parse
1561 while ((elem_type = get_bits(&gb, 3)) != TYPE_END) { 1565 while ((elem_type = get_bits(&gb, 3)) != TYPE_END) {
1562 elem_id = get_bits(&gb, 4); 1566 elem_id = get_bits(&gb, 4);