Revision 1d6065ad

View differences:

libavcodec/bink.c
77 77
    DSPContext     dsp;
78 78
    AVFrame        pic, last;
79 79
    int            version;              ///< internal Bink file version
80
    int            has_alpha;
80 81
    int            swap_planes;
81 82
    ScanTable      scantable;            ///< permutated scantable for DCT coeffs decoding
82 83

  
......
692 693
    }
693 694

  
694 695
    init_get_bits(&gb, pkt->data, bits_count);
696
    if (c->has_alpha) {
697
        int aplane_bits = get_bits_long(&gb, 32) << 3;
698
        if (aplane_bits <= 32 || (aplane_bits & 0x1F)) {
699
            av_log(avctx, AV_LOG_ERROR, "Incorrect alpha plane size %d\n", aplane_bits);
700
            return -1;
701
        }
702
        skip_bits_long(&gb, aplane_bits - 32);
703
    }
695 704
    if (c->version >= 'i')
696 705
        skip_bits_long(&gb, 32);
697 706

  
......
927 936
        av_log(avctx, AV_LOG_ERROR, "Too old version '%c'\n", c->version);
928 937
        return -1;
929 938
    }
939
    c->has_alpha = 0; //TODO: demuxer should supply decoder with flags
930 940
    c->swap_planes = c->version >= 'i';
931 941
    if (!bink_trees[15].table) {
932 942
        for (i = 0; i < 16; i++) {

Also available in: Unified diff