Mercurial > libavcodec.hg
comparison aac.c @ 7850:77030651ddd0 libavcodec
Only read some of TNS bitstream data in the case that the TNS filter order is
non-zero as per the specification.
Patch by Alex Converse (alex converse gmail com)
Fixes another issue pertaining to issue632
author | superdump |
---|---|
date | Fri, 12 Sep 2008 14:32:49 +0000 |
parents | e4edcbbca3f3 |
children | a6afd0f2a849 |
comparison
equal
deleted
inserted
replaced
7849:2bfde5b45e01 | 7850:77030651ddd0 |
---|---|
627 av_log(ac->avccontext, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.", | 627 av_log(ac->avccontext, AV_LOG_ERROR, "TNS filter order %d is greater than maximum %d.", |
628 tns->order[w][filt], tns_max_order); | 628 tns->order[w][filt], tns_max_order); |
629 tns->order[w][filt] = 0; | 629 tns->order[w][filt] = 0; |
630 return -1; | 630 return -1; |
631 } | 631 } |
632 if (tns->order[w][filt]) { | |
632 tns->direction[w][filt] = get_bits1(gb); | 633 tns->direction[w][filt] = get_bits1(gb); |
633 coef_compress = get_bits1(gb); | 634 coef_compress = get_bits1(gb); |
634 coef_len = coef_res + 3 - coef_compress; | 635 coef_len = coef_res + 3 - coef_compress; |
635 tmp2_idx = 2*coef_compress + coef_res; | 636 tmp2_idx = 2*coef_compress + coef_res; |
636 | 637 |
637 for (i = 0; i < tns->order[w][filt]; i++) | 638 for (i = 0; i < tns->order[w][filt]; i++) |
638 tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]; | 639 tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]; |
640 } | |
639 } | 641 } |
640 } | 642 } |
641 } | 643 } |
642 return 0; | 644 return 0; |
643 } | 645 } |