avcodec/huffyuvdec: don't prepare unnecessary joint tables

The number of planes can be lower than 4.
This commit is contained in:
Christophe Gisquet 2016-06-11 09:31:13 +02:00 committed by Paul B Mahol
parent 67d392b979
commit 8028b8260e
1 changed files with 2 additions and 1 deletions

View File

@ -168,8 +168,9 @@ static int generate_joint_tables(HYuvDecContext *s)
len = (uint8_t *)(bits + (1 << VLC_BITS));
if (s->bitstream_bpp < 24 || s->version > 2) {
int count = 1 + s->alpha + 2 * s->chroma;
int p, i, y, u;
for (p = 0; p < 4; p++) {
for (p = 0; p < count; p++) {
int p0 = s->version > 2 ? p : 0;
for (i = y = 0; y < s->vlc_n; y++) {
int len0 = s->len[p0][y];