Commit 51673647 authored by Alex Converse's avatar Alex Converse Committed by Robert Swain

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

Originally committed as revision 15303 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 08857704
...@@ -629,6 +629,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns, ...@@ -629,6 +629,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns,
tns->order[w][filt] = 0; tns->order[w][filt] = 0;
return -1; return -1;
} }
if (tns->order[w][filt]) {
tns->direction[w][filt] = get_bits1(gb); tns->direction[w][filt] = get_bits1(gb);
coef_compress = get_bits1(gb); coef_compress = get_bits1(gb);
coef_len = coef_res + 3 - coef_compress; coef_len = coef_res + 3 - coef_compress;
...@@ -636,6 +637,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns, ...@@ -636,6 +637,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns,
for (i = 0; i < tns->order[w][filt]; i++) for (i = 0; i < tns->order[w][filt]; i++)
tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)]; tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment