tscc2: fix out of array access
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Oct 2012 00:26:50 +0000 (02:26 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 12 Oct 2012 00:26:50 +0000 (02:26 +0200)
Fixes CID732260
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/tscc2.c

index 483e97f..8692819 100644 (file)
@@ -173,7 +173,7 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set,
                 if (ac == 0x1000)
                     ac = get_bits(gb, 12);
                 bpos += ac & 0xF;
-                if (bpos >= 64)
+                if (bpos >= 16)
                     return AVERROR_INVALIDDATA;
                 val = sign_extend(ac >> 4, 8);
                 c->block[tscc2_zigzag[bpos++]] = val;