av_log(s->avctx, AV_LOG_DEBUG, "invalid sample size code (%d)\n", sample_size_code);
av_log(s->avctx, AV_LOG_ERROR, "invalid sample size code (%d)\n", sample_size_code);
static int decode_frame(FLACContext *s){    int blocksize_code, sample_rate_code, sample_size_code, assignment, i, crc8;    int decorrelation, bps, blocksize, samplerate;        blocksize_code = get_bits(&s->gb, 4);    sample_rate_code = get_bits(&s->gb, 4);        assignment = get_bits(&s->gb, 4); /* channel assignment */    if (assignment < 8 && s->channels == assignment+1)        decorrelation = INDEPENDENT;    else if (assignment >=8 && assignment < 11 && s->channels == 2)        decorrelation = LEFT_SIDE + assignment - 8;    else    {        av_log(s->avctx, AV_LOG_DEBUG, "unsupported channel assignment %d (channels=%d)\n", assignment, s->channels);        return -1;    }            sample_size_code = get_bits(&s->gb, 3);    if(sample_size_code == 0)        bps= s->bps;    else if((sample_size_code != 3) && (sample_size_code != 7))        bps = sample_size_table[sample_size_code];    else     {        av_log(s->avctx, AV_LOG_DEBUG, "invalid sample size code (%d)\n", sample_size_code);        return -1;    }    if (get_bits1(&s->gb))    {        av_log(s->avctx, AV_LOG_DEBUG, "broken stream, invalid padding\n");        return -1;    }        if(get_utf8(&s->gb) < 0){        av_log(s->avctx, AV_LOG_ERROR, "utf8 fscked\n");        return -1;    }#if 0        if (/*((blocksize_code == 6) || (blocksize_code == 7)) &&*/        (s->min_blocksize != s->max_blocksize)){    }else{    }#endif        if (blocksize_code == 0)        blocksize = s->min_blocksize;    else if (blocksize_code == 6)        blocksize = get_bits(&s->gb, 8)+1;    else if (blocksize_code == 7)        blocksize = get_bits(&s->gb, 16)+1;    else         blocksize = blocksize_table[blocksize_code];    if(blocksize > s->max_blocksize){        av_log(s->avctx, AV_LOG_ERROR, "blocksize %d > %d\n", blocksize, s->max_blocksize);        return -1;    }    if (sample_rate_code == 0){        samplerate= s->samplerate;    }else if ((sample_rate_code > 3) && (sample_rate_code < 12))        samplerate = sample_rate_table[sample_rate_code];    else if (sample_rate_code == 12)        samplerate = get_bits(&s->gb, 8) * 1000;    else if (sample_rate_code == 13)        samplerate = get_bits(&s->gb, 16);    else if (sample_rate_code == 14)        samplerate = get_bits(&s->gb, 16) * 10;    else{        av_log(s->avctx, AV_LOG_ERROR, "illegal sample rate code %d\n", sample_rate_code);        return -1;    }    skip_bits(&s->gb, 8);    crc8= get_crc8(s->gb.buffer, get_bits_count(&s->gb)/8);    if(crc8){        av_log(s->avctx, AV_LOG_ERROR, "header crc mismatch crc=%2X\n", crc8);        return -1;    }        s->blocksize    = blocksize;    s->samplerate   = samplerate;    s->bps          = bps;    s->decorrelation= decorrelation;//    dump_headers(s);    /* subframes */    for (i = 0; i < s->channels; i++)    {//        av_log(s->avctx, AV_LOG_DEBUG, "decoded: %x residual: %x\n", s->decoded[i], s->residual[i]);        if (decode_subframe(s, i) < 0)            return -1;    }        align_get_bits(&s->gb);    /* frame footer */    skip_bits(&s->gb, 16); /* data crc */    return 0;}