]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Only read some of TNS bitstream data in the case that the TNS filter order is
authorsuperdump <superdump@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 12 Sep 2008 14:32:49 +0000 (14:32 +0000)
committersuperdump <superdump@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 12 Sep 2008 14:32:49 +0000 (14:32 +0000)
non-zero as per the specification.

Patch by Alex Converse (alex converse gmail com)
Fixes another issue pertaining to issue632

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15303 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/aac.c

index cc069ed7c666d7259c6f9a4f4c7ee6601befe5a5..18c2cbc6d99534115e94213600f8ab3561953c4b 100644 (file)
@@ -629,6 +629,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns,
                     tns->order[w][filt] = 0;
                     return -1;
                 }
+                if (tns->order[w][filt]) {
                 tns->direction[w][filt] = get_bits1(gb);
                 coef_compress = get_bits1(gb);
                 coef_len = coef_res + 3 - coef_compress;
@@ -636,6 +637,7 @@ static int decode_tns(AACContext * ac, TemporalNoiseShaping * tns,
 
                 for (i = 0; i < tns->order[w][filt]; i++)
                     tns->coef[w][filt][i] = tns_tmp2_map[tmp2_idx][get_bits(gb, coef_len)];
+                }
             }
         }
     }